Regular expression syntax
A regular expression has the following syntax
The pattern consists of metacharacters
, which have special meaning, and ordinary characters, which match themselves.
The pattern describes one or more strings to match when searching text.
A string containing the text to replace for successful match of Pattern.
Character escapes and substitutions
are the only special constructs recognized in a replacement pattern.
You can modify a regular expression pattern with options
that affect matching behavior.
For this purpose regular expressions can have various modifiers.
Modifiers that relate to the interpretation of the regular expression
are listed below.
Specifies case-insensitive matching.
Specifies single-line mode.
Changes the meaning of the period character ( . )
to match any character whatsoever, even a newline, which normally it would not match.
Specifies multiline mode.
Changes the meaning of ^ and $ so that they match at the beginning
and end, respectively, of any line,
not just the beginning and end of the whole string.
Specifies global replace mode.
Indicates that a search should find and replace all occurrences of the pattern
within the searched string, not just the first one.
Extend your pattern's legibility by permitting whitespace and comments.
Match a repeated word in any case.
Match a date with format dd-mm-yyyy.
Change date format from dd/mm/yyyy to mm-dd-yyyy.
Enclose any word with brackets.
Remove leading and trailing spaces from a string.
Remove leading and trailing spaces from each line in a string.
|Copyright © NikaSoft 2004-2005|