Skip to content

Instantly share code, notes, and snippets.

@Hamz-a
Last active March 25, 2022 15:04
Show Gist options
  • Save Hamz-a/1662d09db09156e8b2b0 to your computer and use it in GitHub Desktop.
Save Hamz-a/1662d09db09156e8b2b0 to your computer and use it in GitHub Desktop.

Reference - What does this regex mean?

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?

[tag:regex] 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: [tag:php], [tag:perl], [tag:javascript], [tag:python], [tag:ruby], [tag:java], [tag:.net].
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? [tag:.net]

The list

Quantifiers:

Character classes:

Anchors:

Groups:

Lookaround:

Modifiers:

Escape sequence:

Other: not sure about the name ...

Control verbes: [tag:php] [tag:perl]

Recursion: [tag:php] [tag:perl]

Advanced regex-fu

@Hamz-a
Copy link
Author

Hamz-a commented Mar 25, 2022

@ElectricRCAircraftGuy I actually forgot I've even put this on GitHub (as a gist). The most up to date version is on Stack Overflow with contributions of the community. I don't think it makes sense to have two versions of the reference. I'm not sure why I even put it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment