package re
RE is a regular expression library for OCaml
Install
Dune Dependency
github.com
Readme
Changelog
LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception License
Edit opam file
Versions (19)
Authors
Maintainers
Sources
1.13.2.tar.gz
md5=df37d9787450525a2182ce4364048d11
sha512=376b3ba1e351317a34b4c9a331fdc9ca5ae7c6a90eb2eb3393403a33b9f35ece63af7444a7c0c71ef29d512aa7fe56f7e485a118946e35d90039ddfd9127c020
doc/re/Re/Posix/index.html
Module Re.Posix
Source
References:
Example of how to use this module (to parse some IRC logs):
type msg =
{ time : string
; author : string
; content : string
}
let re = Core.compile (Re_posix.re "([^:].*:[^:]*:[^:]{2})<.([^>]+)> (.+)$")
(* parse a line *)
let match_line line =
try
let substrings = Core.exec re line in
let groups = Core.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 *)
;;
Errors that can be raised during the parsing of the regular expression
Parsing of a Posix extended regular expression
compile r
is defined as Core.compile (Core.longest r)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>