Dune_reSourceRegular expression
Compiled regular expression
Compile a regular expression into an executable version that can be used to match strings, e.g. with exec.
exec re str matches str against the compiled expression re, and returns the matched groups if any.
Similar to exec, but returns an option instead of using an exception.
Similar to exec, but returns true if the expression matches, and false if it doesn't
More detailed version of exec_p
Repeatedly calls exec on the given string, starting at given position and length.
Same as all, but extracts the matched substring rather than returning the whole group. This basically iterates over matched strings
split re s splits s into chunks separated by re. It yields the chunks themselves, not the separator. For instance this can be used with a whitespace-matching re such as "[\t ]+".
split re s splits s into chunks separated by re. It yields the chunks along with the separators. For instance this can be used with a whitespace-matching re such as "[\t ]+".
val replace :
?pos:int ->
?len:int ->
?all:bool ->
re ->
f:(Group.t -> string) ->
string ->
stringreplace ~all re ~f s iterates on s, and replaces every occurrence of re with f substring where substring is the current match. If all = false, then only the first occurrence of re is replaced.
replace_string ~all re ~by s iterates on s, and replaces every occurrence of re with by. If all = false, then only the first occurrence of re is replaced.
repn re i j matches re at least i times and at most j times, bounds included. j = None means no upper bound.
when matching against nest e, only the group matching in the last match of e will be considered as matching
Mark a regexp. the markid can then be used to know if this regexp was used.
Alias for pp_re. Deprecated
.
Same as Group.offset. Deprecated
Same as Group.all_offset. Deprecated
Same as Group.test. Deprecated
Same as Mark.all. Deprecated