in reply to Re: Re: A Perl aptitude test
in thread A Perl aptitude test
The phrase "Regular Expression" is a mathematical concept predating perl and emacs and sed. Quoting from Freidl's Mastering Regular Expressions:
The seeds of regular expressions were planted in the early 1940s... Through the 1950s and 1960s, regular expressions enjoyed a rich study in theoretical mathematical circles... Ken Thompson's 1968 article Regular Expression Search Algorithm... led to his work on qed, an editor that formed the basis for the Unix editor, ed.
Regular expressions are expressions that regulate a sequence as belonging to a set, or not belonging to a set. (What, you thought 'regular' as in 'everyday' or 'fixed interval'?)
Since (?{}) doesn't fail and cause the engine to backtrack or bail, it's not regulating anything. The regex syntax handles the wrapping stuff but the contents are what's doing the string-modifying, and the results have no direct bearing on the regulation. That's what I mean when I say that (?{}) is not a regular expression.
(I know, I'm forever editing and extending my comments with afterthoughts rather than creating new followups.)
--
[ e d @ h a l l e y . c c ]
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: A Perl aptitude test ("regular" expressions)
by Aristotle (Chancellor) on May 03, 2003 at 01:09 UTC |