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
/
^(MAS|VIS| CRE)\d\{11}
/
^ asserts position at start of the string
1st Capturing Group
(MAS|VIS| CRE)
1st Alternative
MAS
MAS
matches the characters MAS literally (case sensitive)
2nd Alternative
VIS
VIS
matches the characters VIS literally (case sensitive)
3rd Alternative
CRE
CRE
matches the characters CRE literally (case sensitive)
\d matches a digit (equivalent to [0-9])
\{ matches the character { with index 12310 (7B16 or 1738) literally (case sensitive)
11}
matches the characters 11} literally (case sensitive)
Your regular expression does not match the subject string.

Regular Expression
No Match

/
/

Test String