views:

128

answers:

3

I wonder if there is a comparison between the features of various regex metacharacters in various implementations.

The sort of thing I am looking for is a table like

Language       Perl    sed
grouping       ( )     \( \)

Languages I am interested in are Perl, Sed Java Javascript

+10  A: 

There's a comprehensive comparison page here: Regular Expression Flavor Comparison.

Some languages implement a particular style, so look up your language on that page and determine which column to look at. For example, JavaScript will be under ECMA. For sed it depends on whether you're using UNIX or Linux (from the page):

The sed UNIX tool uses POSIX BRE. Linux usually ships with the GNU implementation, which use "GNU BRE".

Ahmad Mageed
You may find very useful a tool called "regex buddy", it allows to convert regular expressions from one language to another.
gasan
+6  A: 

A script called txt2regex allows you to build a regex and shows you the syntax for various flavors.

txt2regex

Dennis Williamson
+5  A: 

The Wikipedia comparison of regular expression engines chart is comprehensive and easy to understand.

There is also Richard Kettlewell's regexp syntax summary.

drewk
The 2nd link you give is very good.
justintime
Thanks!........
drewk