Difference between revisions of "Regular expressions"
(New page: 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 manipulatio...) |
|||
| Line 2: | Line 2: | ||
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". | 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. | ||
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. | ||
Revision as of 21:42, June 16, 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.
Wildcard characters are useful in matching filenames from a file system, but wildcards differ from regular expressions.