Hi Grant,
What are the pros / cons to creating extended regular
expressions like
the following:
If you want to understand:
- the maths of regular expressions,
- the syntax of regexps which these days expresses more than REs, and
- the regexp engines in programs, the differences in how they work and
what they match, and
- how to efficiently steer an engine's internals
then I recommend Jeffrey Friedl's Mastering Regular Expressions.
http://regex.info/book.html
For matching patterns like the following in log
files?
Mar 2 03:23:38
Do you want speed of matching with some false positives or validation by
regexp rather than post-lexing logic and to what depth, e.g. does this
month have a β31stβ?
/^... .. ..:..:../
You'd said egrep, which is NDFA, but in other engines, alternation order
can matter, e.g. βJβ starts the most months and some months have more
days than others.
/^(J(an|u[nl])|Ma[ry]|A(ug|pr)|Oct|Dec|...
--
Cheers, Ralph.