admin管理员组

文章数量:1220485

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

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

Share Improve this question asked Sep 25, 2010 at 14:32 justintimejustintime 3,6314 gold badges23 silver badges37 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 14

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".

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

本文标签: javaComparison of Regex flavoursStack Overflow