52

What is this?

This is a collection of common Q&A. This is also a Community Wiki, so everyone is invited to participate in maintaining it.

Why is this?

is suffering from give me ze code type of questions and poor answers with no explanation. This reference is meant to provide links to quality Q&A.

What's the scope?

This reference is meant for the following languages: , , , , , , .

This might be too broad, but these languages share the same syntax. For specific features there's the tag of the language behind it, example:

  • What are regular expression Balancing Groups?
Community
  • 1
  • 1
HamZa
  • 13,530
  • 11
  • 51
  • 70
  • 1
    [**I created a meta discussion, everyone is invited >>>**](http://meta.stackexchange.com/questions/228822/regex-reference-and-its-fate) – HamZa Apr 08 '14 at 18:26

1 Answers1

1042

The Stack Overflow Regular Expressions FAQ

See also a lot of general hints and useful links at the tag details page.


Online tutorials

Quantifiers

Character Classes

Escape Sequences

Anchors

(Also see "Flavor-Specific Information → Java → The functions in Matcher")

Groups

Lookarounds

Modifiers

Other:

Common Tasks

Advanced Regex-Fu

Flavor-Specific Information

(Except for those marked with *, this section contains non-Stack Overflow links.)

General information

(Links marked with * are non-Stack Overflow links.)

Examples of regex that can cause regex engine to fail

Tools: Testers and Explainers

(This section contains non-Stack Overflow links.)

pppery
  • 3,434
  • 13
  • 24
  • 37
aliteralmind
  • 18,274
  • 16
  • 66
  • 102
  • 2
    Related: [the question for which an answer](https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454) starts with *"You can't parse [X]HTML with regex."*. – Peter Mortensen Jul 22 '20 at 12:47
  • Perl has more (`(?(` for conditional, for example) but you can read the perl official documentation instead. – user202729 Jan 29 '21 at 07:50