4. RegularExpression versus StringExpressionThere is a close correspondence between the various pattern objects that can be used in general symbolic string patterns and in regular expressions. Here is a list of examples of patterns written as regular expressions and as symbolic string patterns. Pattern objects that can be used in general string patterns, but not in regular expressions, include conditions (/;) and pattern tests (?) that can access general Mathematica code during the match. Some special constructs in regular expressions are not directly available in general string patterns. These include lookahead/lookbehinds and repeats of a given length. They can be embedded into a larger general string pattern by inserting a RegularExpression object.
|