I'm trying to reconcile the differences/similarities between regular expression from formal language theory and automata, and the "regex" offered by programming languages.
These two differ not just in "syntax" (the union +
in regular expressions means |
in regex, and there's no such meta-character as .
in regular expressions, etc.), but also in "semantics", e.g. the regular expression (a+b)*c
describes the regular language, L={a,b}*{c}
, which the string abcd
is not a member of, but the equivalent regex (a|b)*c
would actually find a "match" in the string abcd
(unless I do (a|b)*c$
). Not to mention that "regex" can describe some non-regular languages as well.
Is there a good resource/summary that compares regular expression with "regex"?