HTML and CSS Reference
In-Depth Information
This regular expression contains metacharacters (see Table 17.6). The first one is a
caret (^). The caret metacharacter matches for a string only if it is at the beginning of
the line. The period (.) is used to match for any single character, including a
whitespace. This expression contains three periods, representing any three characters.
To find a literal period or any other character that does not represent itself, the char-
acter must be preceded by a backslash to prevent interpretation.
The expression reads: Search at the beginning of the line for an a , followed by any
three single characters, followed by a c . It will match, for example, abbbc, a123c, a c,
aAx3c , and so on, but only if those patterns were found at the beginning of the line.
Table 17.6
Metacharacters and Metasymbols
What It Matches
Character Class: Single Characters and Digits
Matches any character except newline
Matches any single character in set
Matches any single character not in set
Matches one digit
Matches a nondigit, same as [^0-9]
Matches an alphanumeric (word) character
Matches a nonalphanumeric (nonword) character
Character Class: Whitespace Characters
Matches a null character
Matches a backspace
Matches a formfeed
Matches a newline
Matches a return
Matches whitespace character, spaces, tabs, and newlines
Matches nonwhitespace character
Matches a tab
Search WWH ::

Custom Search