Regular Expressions 101

@regex101
Donate
Sponsor
Contact
Bug Reports & Feedback
Wiki
Whats new?

Save & Share

  • Save Regex
    ctrl+s
  • Update Regex
    ctrl+⇧+s

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python 2.7
  • Golang (RE2)

Function

  • Match
  • Substitution
  • List
  • Unit Tests
/
(\\[cgl]__?)([a-z]+)_([a-z_]+)(_[A-Za-z]+)
/
g
1st Capturing Group
(\\[cgl]__?)
\\ matches the character \ literally (case sensitive)
Match a single character present in the list below
[cgl]
cgl matches a single character in the list cgl (case sensitive)
_ matches the character _ literally (case sensitive)
_?
matches the character _ literally (case sensitive)
? Quantifier — Matches between zero and one times, as many times as possible, giving back as needed (greedy)
2nd Capturing Group
([a-z]+)
Match a single character present in the list below
[a-z]+
+ Quantifier — Matches between one and unlimited times, as many times as possible, giving back as needed (greedy)
a-z a single character in the range between a (index 97) and z (index 122) (case sensitive)
_ matches the character _ literally (case sensitive)
3rd Capturing Group
([a-z_]+)
Match a single character present in the list below
[a-z_]+
+ Quantifier — Matches between one and unlimited times, as many times as possible, giving back as needed (greedy)
a-z a single character in the range between a (index 97) and z (index 122) (case sensitive)
_ matches the character _ literally (case sensitive)
4th Capturing Group
(_[A-Za-z]+)
_ matches the character _ literally (case sensitive)
Match a single character present in the list below
[A-Za-z]+
+ Quantifier — Matches between one and unlimited times, as many times as possible, giving back as needed (greedy)
A-Z a single character in the range between A (index 65) and Z (index 90) (case sensitive)
a-z a single character in the range between a (index 97) and z (index 122) (case sensitive)
Global pattern flags
g modifier: global. All matches (don't return after first match)
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/
g

Test String