class REGEXP
****
< $FINALIZE Sather frontend for regular expressions. As specified in POSIX draft 1003.2/D11.2.


Flattened version is here



Public


Readable Attributes
attr c_str: STR;
**** Regular expression in POSIX syntax.
attr ignore_case: BOOL;
**** True, if regular expression does not respect the case.

Features
any_times: SAME
**** Returns a regular expression matching self in zero or more occurences.
atleast(i:INT): SAME
**** Returns a regular expression matching self in at least i occurences.
atmost(i:INT): SAME
**** Returns a regular expression matching self in zero or at most 'i' occurences.
beginning: SAME
**** Returns a regular expression matching the beginning of the string.
between(i,j:INT): SAME
**** Returns a regular expression matching self in between 'i' and 'j' occurences.
char: SAME
**** Returns a regular expression matching one arbitrary char.
compile
**** Preparation of a regular expression to be used in 'match'. If not called before, will be called automatically on the first call to 'match'.
digit: SAME
**** Returns a regular expression matching '0', '1' .. or '9'.
ending: SAME
**** Returns a regular expression matching the end of a string.
letter: SAME
**** Returns a regular expression matching 'a' .. 'z' or 'A' .. 'Z'
lowercase: SAME
**** Returns a regular expression matching 'a', 'b' .. or 'z'
match( s:STR ): BOOL
**** Peturns true if the string 's' is being accepted by the regular expression
match( s:STR, out from: INT, out to: INT )
**** Peturns the first position of 'string' matching the regular and the position of the first character after the match. 'from' and 'to' are -1 when no match is found.
nocase: SAME
**** Returns a regular expression as self but ignoring the case
noneof(s:STR): SAME
**** Returns a regular expression matching none of the chars in 's'.
oneof(s:STR): SAME
**** Returns a regular expression matching one of the chars in 's'.
plus( r:SAME ): SAME
**** Returns a regular expression matching self or r. Ignores the case when one of the subexpressions ignores the case.
pow( r:SAME ): SAME
**** Returns a regular expression machting self and then r. Ignores the case when one of the subexpressions ignores the case.
regexp(s:STR,ignorecase:BOOL): SAME
**** Passing a regular expression directly from string 's' using the POSIX syntax. (Special meanings are carried by unescaped characters.) Returns void if the expression is illegal.
str(s:STR): SAME
**** Returns a regular expression matching exactly the string 's'
uppercase: SAME
**** Returns a regular expression matching 'A', 'B' .. or 'Z'
usecase: SAME
**** Returns a regular expression as self but respecing case.
whitespace: SAME
**** Returns a regular expression matching ' ','\t','\v' and '\n'


Private

attr c_regexp: EXT_OB;
**** Compiled version of the regular expression.
attr c_regexp: EXT_OB;
**** Compiled version of the regular expression.
attr c_str: STR;
**** Regular expression in POSIX syntax.
escape(s:STR): STR
**** Returns a string in which all characters with special meaning are escaped to keep their literal meaning.
finalize
**** The internal buffers of the POSIX regexp may keep some of the buffers reachable, meaning unreachable for GC.
attr ignore_case: BOOL;
**** True, if regular expression does not respect the case.
init(s:STR): SAME
init(s:STR,ignorecase:BOOL): SAME
**** Internal creation routine.
normalize(s:STR): STR
**** Returns a normalized version of 's'. Characters with special meaning in bracket expressions are rearranged to keep literal meaning.

The Sather Home Page