Homer Library
RegularExpression
The regular expression syntax which I have used in my add-ons is the EXTENDED_POSIX_SYNTAX:
This constructs the regular expression regex given as a string. You can optionally specify the particular syntax of regex among the following set:
An additional flag (ICASE_SYNTAX) can be used to specify that the regular expression is case insensitive.
- EMACS_SYNTAX
- AWK_SYNTAX
- GNU_AWK_SYNTAX
- POSIX_AWK_SYNTAX
- GREP_SYNTAX
- EGREP_SYNTAX
- POSIX_EGREP_SYNTAX
- ED_SYNTAX
- SED_SYNTAX
- BASIC_POSIX_SYNTAX
- MININAL_BASIC_POSIX_SYNTAX
- EXTENDED_POSIX_SYNTAX
- EXTENDED_MINIMAL_POSIX_SYNTAX
frees internal stuff
Returns whether the regular expression has successfully been compiled (B_OK) or not (B_BAD_VALUE). B_BAD_VALUE can also be returned if the fast map could not be compiled (if requested).
These methods are used to set or unset the translation table used by the regular expression. Basically, it is an array which is used to translate the input characters and implement case sensitiveness. However, you can use this table to set any kind of translation.
SetTranslation set the translation for characters c1 to c1+length to c2 to c2+length. For instance:
SetTranslation('A', 'a', uint32('z'-'a'+1));
sets the regular expression case sensitive, and
SetTranslation('a', 'a', uint32('z'-'a'+1));
sets the regular expression case insensitive.
However, you should stick with the SetCaseSensitive() and SetCaseInsensitive() methods
when it comes to case sensitiveness.
These methods are used to set the case sensitiveness of the regular expressions. Basically, they set the translation table by calling the SetTranslation method. Note that the translation map is only affected for alphabetical characters if a translation map exists.
This page was last updated on 12/12/99.