Difference between revisions of "Regular expressions"
(added cite) |
|||
| Line 4: | Line 4: | ||
For example, "\b" is a command that refers to a break at the beginning or end of a word. The regular expression \bin will match all words that have "in" at the beginning or end of the word break. For "the soul inside the thin and sinister man," the regular expression "\bin" would match "inside" and "thin", but not sinister. | For example, "\b" is a command that refers to a break at the beginning or end of a word. The regular expression \bin will match all words that have "in" at the beginning or end of the word break. For "the soul inside the thin and sinister man," the regular expression "\bin" would match "inside" and "thin", but not sinister. | ||
| + | |||
| + | An online reference manual for the syntax of regular expressions is available.<ref>http://www.regular-expressions.info/reference.html</ref> | ||
Wildcard characters are useful in matching filenames from a file system, but wildcards differ from regular expressions. | Wildcard characters are useful in matching filenames from a file system, but wildcards differ from regular expressions. | ||
| + | |||
| + | == References == | ||
| + | |||
| + | <references/> | ||
Revision as of 01:33, June 17, 2007
A regular expression in computer software is a string for matching other strings that contain it.
Text editors and programming languages support regular expressions for string manipulation. UNIX and Perl have a regular expression engines like "grep" in UNIX. "Regular expression" is abbreviated as "regex", or "regexp".
For example, "\b" is a command that refers to a break at the beginning or end of a word. The regular expression \bin will match all words that have "in" at the beginning or end of the word break. For "the soul inside the thin and sinister man," the regular expression "\bin" would match "inside" and "thin", but not sinister.
An online reference manual for the syntax of regular expressions is available.[1]
Wildcard characters are useful in matching filenames from a file system, but wildcards differ from regular expressions.