On this page... (hide)
In computing, a regular expression is a string that is used to describe or match a set of strings, according to certain syntax rules. For example, the regular expression
\bex can be used to describe (and search for) all of the instances of the string “ex” that occur at word breaks (signified by the \
b). Thus in the phrase, “Texts for expert experimenters,” the regular expresssion
\bex returens the “ex” in “expert” and “experimenters,” but not in “Texts” (because the “ex” occurs inside the word there and not at the word break). Regular expressions are used by many text editors and utilities to search and manipulate bodies of text based on certain patterns. Many programming languages support regular expressions for string manipulation. For example, Perl and Tcl have a powerful regular expression engine built directly into their syntax. The set of utilities (including the editor ed and the filter grep) provided by Unix distributions were the first to popularize the concept of regular expressions. “Regular expression” is often shortened in speech to regex, and in writing to regexp or regex (singular) or regexps, regexes, or regexen (plural).
Many modern computing systems provide wildcard characters in matching filenames from a file system. This is a core capability of many command-line shells and is known as globbing. Wildcards differ from regular expressions in that they can only express very restrictive forms of alternation.
You know, “regexp” is just plain stupid, and unpronouncable. “Regex” is so much easier.
Wayne hits the nail on the head - except for the whole “soft ‘g’” thing.
O’Reilly: Five Habits for Successful Regular Expressions: comments, tests, etc.
^txt2regex$: Regular Expression Tool To Create Regex from Description -- Unix tool; haven’t used it (here for future reference). I’m usually suspicious of these natural-language→regex parsers. There’s something similar in Emacs that I also avoid.
IBM’s Essential aids in building and testing regular expressions (on UNIX systems) -- Grep? and Emacs, mostly.
Steven Levithan: Top 10 reasons to learn and use Regular Expressions
free online regex tester(approve sites) - uses ActionScript 3 - so it s/b identical to the JS flavor
No comments yet.