Regular Expressions 101

Save & Share

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java 8

Function

  • Match
  • Substitution
  • List
  • Unit Tests
/
(ADM|CHE)\d{9}
/
i
1st Capturing Group
(ADM|CHE)
1st Alternative
ADM
ADM
matches the characters ADM literally (case insensitive)
2nd Alternative
CHE
CHE
matches the characters CHE literally (case insensitive)
\d
matches a digit (equivalent to [0-9])
{9} matches the previous token exactly 9 times
Global pattern flags
i modifier: insensitive. Case insensitive match (ignores case of [a-zA-Z])
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/
i

Test String