![]() |
![]()
| ![]() |
![]()
NAMEregex myr-regex LIBRARYregex SYNOPSISuse regex const compile : (re : byte[:] ->
std.error(regex#, status)) const dbgcompile : (re : byte[:] ->
std.error(regex#, status)) const free : (re : regex# -> void)
DESCRIPTIONThe regex library provides functions for compiling and evaluating regular expressions, as described later in this document, or in myr-regex(7). regex.compile will take a string describing a regex, and will attempt to compile it, returing `std.Success regex# if the regex is valid, and there were no error conditions encountered during compilation. If the compilation failed, `std.Failure regex.status will be returned, where regex.status is a failure code. regex.dbgcompile is identical to regex.compile, however, it will print debugging information as it compiles, and each time the regex is evaluated. regex.exec will take the regex passed to it, and evaluate it over the text provided, returning the `std.Some matches, or `std.None if there were no matches found. The matches must span the whole string. regex.search is similar to regex.exec, but it will attempt to find a match somewhere within the string, instead of attempting to find a match spanning the whole string. REGEX SYNTAXThe grammar used by libregex is below:
The following metacharacters have the meanings listed below:
In order to match a literal metacharacter, it needs to be preceded by a '\' character. The following character classes are supported:
Unicode properties that are supported are listed below:
EXAMPLE
FILESThe source code for this compiler is available from git://git.eigenstate.org/git/ori/libregex.git SEE ALSO6m(1) BUGSThis code is insufficiently tested. This code does not support all of the regex features that one would expect.
|