Ilya Zakharevich said:
[A complimentary Cc of this posting was sent to
Anno Siegel
The mathematicians who work with regular expressions are just a club of
pedants?
Can't answer this question; never saw a mathematician who works with
regular expressions. 1/5 ;-)
Okay, but some work with grammars and like to distinguish regular grammars,
which are defined using regular expressions.
This is, BTW, the reason why the mathematical notion of regular expressions
was never amended with backreferences, the way computer implementations are.
In the theory of grammars and languages, it is the distinguishing property
of regularity that some constructs (like nested parentheses, but even
simpler ones) cannot be parsed. Extending the capabilities of regular
expressions would spoil the game.
But in general, [with a few exceptions] mathematicians do not mind the
same word having different meanings in different contexts. Too few
words, too many things to work over....
Not at all. Mathematics has practiced operator overloading long before
it was named thus.
Nor do I have a problem with "regular expression" meaning two different
things in different disciplines. But the case is not quite like "index"
meaning two essentially unrelated things to a mathematician and a librarian.
The computer notion of "regex" was derived from the earlier mathematical
model and is essentially (down to the notation) the same thing.
Being practitioners, computer people soon invented shortcuts and extended
notations in their hackish ways. Many of these (like character classes,
or {m,n} quantifiers) are inessential and don't change the power of
what a regex can do, only the ease of expressing it. The introduction
of backreferences *does* change the expressive power of regexes, in a
way that was, and still is, deliberately excluded from the mathematical
definition. That can lead to contradictory statements about "regular
expressions", which, depending on who is speaking, are both correct.
This particular relationship deserves an explanation when it comes up.
Anno