1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798(** Symbolic construction of emacs regexps.
[(describe-function 'rx)]
N.B. These bindings are incomplete only due to laziness (in the technical sense). *)open!Coreopen!ImportmoduleNamed_char_class=structtypet=|Alphabetic|Alphanumeric|Digit|Hex_digit|Lower|Space|Upper|Word[@@derivingenumerate,sexp_of]endmoduleChar_class=structtypet=|Chars_inofstring(** [Chars_in s] matches characters in [s] (e.g., "[:digit:]" matches ':') *)|NamedofNamed_char_class.t(** [Named name] matches characters from a named character class, e.g., [alpha]. *)|Rangeofchar*char(** [Range (c1, c2)] matches characters between [c1] and [c2] inclusive. *)[@@derivingsexp_of]endmoduleStart_or_end=structtypet=|End|Start[@@derivingsexp_of]endmoduleT=structtypet=|Any_char|Any_inofChar_class.tlist|Exactlyofstring(** [Exactly s] matches exactly the string [s] (e.g., '.' only matches '.') *)|LineofStart_or_end.t|None_inofChar_class.tlist|One_or_moreoft|Oroftlist|Patternofstring(** [Pattern s] interprets [s] as a regexp (e.g., '.' matches any character) *)|Point(** Matches zero characters, but only where the point is. *)|Repeatof{min:int;max:intoption;t:t}|Seqoftlist|Submatchoft(** Text matched by [Submatch] can be retrieved using [Regexp.Last_match.text_exn
~subexp:index].
[index] is the number of parentheses to the left of this submatch in the regexp
pattern. *)|Submatch_nof{index:int;t:t}(** Text matched by [Submatch_n] can be retrieved using [Regexp.Last_match.text_exn
~subexp:index].
[index] must be at least the number of parentheses left of this submatch in the
regexp pattern. If [index] is greater, it will shadow the submatch that would have
been assigned that index. If [index] is less, then it is an error to use the
resulting regexp. *)|Zero_or_moreoft|Zero_or_oneoft[@@derivingsexp_of]endmoduletypeRx=sigmoduleNamed_char_class:moduletypeofstructincludeNamed_char_classendmoduleChar_class:moduletypeofstructincludeChar_classendmoduleStart_or_end:moduletypeofstructincludeStart_or_endendincludemoduletypeofTwithtypet=T.tvalpattern:t->stringend