Summary of differences in regular expression syntax for various tools and languages?
Question
I can never remember the differences in regular expression syntax used by tools like grep and AWK, or languages like Python and PHP. Generally, Perl has the most expansive syntax, but I'm often hamstrung by the limitations of even egrep
("extended" grep
).
Is there a site that lists the differences in a concise and easy-to-read fashion?
Solution
Mastering Regular Expressions, devotes the last four chapters to Java, PHP, Perl, and .NET. One chapter for each. From what I know, the pocket edition contains just those final four chapters.
OTHER TIPS
For my own future reference, I'll offer the Regexp Syntax Summary page which contrasts the syntax for grep
, egrep
, Emacs, Perl, Python, and Tcl. As expected, Perl supports the greatest variety of operators, but Python looks equally capable, if not more so.
I find this site helpful: http://www.regular-expressions.info/
Other than that, I use the corresponding documentation extensively and I believe, all said and done, there's no way around that.