package re
RE is a regular expression library for OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
ocaml-re-1.3.2.tar.gz
sha256=3a34c3d6b6bf61e0d1eb9af74fa82c936809f7e48f8872fb6b11252c79a5d466
md5=1622796daf07397b266738e6710db4f3
doc/re.posix/Re_posix/index.html
Module Re_posix
References:
Example of how to use this module (to parse some IRC logs):
type msg = {
time:string;
author:string;
content:string;
}
let re = Re.compile (Re_posix.re "([^:].*:[^:]*:[^:]{2})<.([^>]+)> (.+)$")
(* parse a line *)
let match_line line =
try
let substrings = Re.exec re line in
let groups = Re.get_all substrings in
(* groups can be obtained directly by index within [substrings] *)
Some {time=groups.(1); author=groups.(2); content=groups.(3)}
with Not_found ->
None (* regex didn't match *)
XXX Character classes
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>