These functions are defined in rgx.c using a POSIX or GNU regex library. If your computer does not support regex, a package is available via ftp from ftp.gnu.org:/pub/gnu/regex-0.12.tar.gz. For a description of regular expressions, See syntax.
Compile a regular expression. Return a compiled regular expression, or an integer error code suitable as an argument to
regcompis a string of option letters used to control the compilation of the regular expression. The letters may consist of:
- newlines won't be matched by
.or hat lists; (
- ignore case.
only when compiled with _GNU_SOURCE:
- allows dot to match a null character.
- enable GNU fastmaps.
Returns a string describing the integer errno returned when
#for a vector of integers. These integers are in doublets. The first of each doublet is the index of string of the start of the matching expression or sub-expression (delimited by parentheses in the pattern). The last of each doublet is index of string of the end of that expression.
#fis returned if the string does not match.
#tif the pattern such that regexp = (regcomp pattern) matches string as a POSIX extended regular expressions. Returns
Regsearchsearches for the pattern within the string.
Regmatchanchors the pattern and begins matching it against string.
Regsearchreturns the character position where re starts, or
#fif not found.
Regmatchreturns the number of characters matched,
#fif not matched.
regmatchvreturn the match vector is returned if re is found,
- may be either:
- a compiled regular expression returned by
- a string representing a regular expression;
- a list of a string and a set of option letters.
- The string to be operated upon.
- The character position at which to begin the search or match. If absent, the default is zero.
Compiled _GNU_SOURCE and using GNU libregex only
When searching, if start is negative, the absolute value of start will be used as the start location and reverse searching will be performed.
- The search is allowed to examine only the first len characters of string. If absent, the entire string may be examined.
String-splitsplits a string into substrings that are separated by re, returning a vector of substrings.
String-splitvreturns a vector of string positions that indicate where the substrings are located.
Returns the edited string.
- Is a string used to replace occurances of re. Backquoted integers in the range of 1-9 may be used to insert subexpressions in re, as in
- The number of substitutions for
string-editto perform. If
#t, all occurances of re will be replaced. The default is to perform one substitution.