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
  • Java 8

Function

  • Match
  • Substitution
  • List
  • Unit Tests
/
(ab|cd)e(fg|hi)
/
g
1st Capturing Group
(ab|cd)
1st Alternative
ab
ab matches the characters ab literally (case sensitive)
2nd Alternative
cd
cd matches the characters cd literally (case sensitive)
e matches the character e literally (case sensitive)
2nd Capturing Group
(fg|hi)
1st Alternative
fg
fg matches the characters fg literally (case sensitive)
2nd Alternative
hi
hi matches the characters hi literally (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

Substitution

Processing...