The matching is considered to be "greedy", because at any given point, it will always match the longest possible substring. For example, if a regular expression could match the substring 'aa' or 'aaa', it will always take the longer option. Most characters in a regular expression are "ordinary", which indicates that they have no special meaning and only match themselves. Certain characters, sometimes called "meta characters", have special meanings. To use a meta character as an ordinary character, you need to "escape" it by preceding it with a backslash character (for example, "\*"). The meta characters are described in the following table: The open bracket character indicates a "bracket expression", discussed below. The close bracket character terminates such an expression. The backslash suppresses the special meaning of the character it precedes, and turns it into an ordinary character. To insert a backslash into your regular expression pattern, use a double backslash ('\\'). The open parenthesis indicates a "subexpression", discussed below. The close parenthesis character terminates such a subexpression. Zero or more of the character or expression to the left. Hence, 'a*' means zero or more instances of 'a'. One or more of the character or expression to the left. Hence, 'a ' means one or more instances of 'a'. Zero or one of the character or expression to the left. To extract subexpressions using the SUBEXPR keyword to the Extract() method.īracket expressions (expressions enclosed in square brackets) are used to specify a set of characters that can satisfy a match.Hence, 'a?' will match 'a' or the empty string ' '.Īn interval qualifier allows you to specify exactly how many instances of the character or expression to the left to match.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |