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
/
[A-Z]{6}[0-9LMNPQRSTUV]{2}[A-Z]{1}[0-7LMNPQRST]{1}[0-9LMNPQRSTUV]{1}[A-Z]{1}[0-9LMNPQRSTUV]{3}[A-Z]{1}
/
Match a single character present in the list below
[A-Z]
{6} matches the previous token exactly 6 times
A-Z matches a single character in the range between A (index 65) and Z (index 90) (case sensitive)
Match a single character present in the list below
[0-9LMNPQRSTUV]
{2} matches the previous token exactly 2 times
0-9 matches a single character in the range between 0 (index 48) and 9 (index 57) (case sensitive)
LMNPQRSTUV
matches a single character in the list LMNPQRSTUV (case sensitive)
Match a single character present in the list below
[A-Z]
{1} matches the previous token exactly one time (meaningless quantifier)
A-Z matches a single character in the range between A (index 65) and Z (index 90) (case sensitive)
Match a single character present in the list below
[0-7LMNPQRST]
{1} matches the previous token exactly one time (meaningless quantifier)
0-7 matches a single character in the range between 0 (index 48) and 7 (index 55) (case sensitive)
LMNPQRST
matches a single character in the list LMNPQRST (case sensitive)
Match a single character present in the list below
[0-9LMNPQRSTUV]
{1} matches the previous token exactly one time (meaningless quantifier)
0-9 matches a single character in the range between 0 (index 48) and 9 (index 57) (case sensitive)
LMNPQRSTUV
matches a single character in the list LMNPQRSTUV (case sensitive)
Match a single character present in the list below
[A-Z]
{1} matches the previous token exactly one time (meaningless quantifier)
A-Z matches a single character in the range between A (index 65) and Z (index 90) (case sensitive)
Match a single character present in the list below
[0-9LMNPQRSTUV]
{3} matches the previous token exactly 3 times
0-9 matches a single character in the range between 0 (index 48) and 9 (index 57) (case sensitive)
LMNPQRSTUV
matches a single character in the list LMNPQRSTUV (case sensitive)
Match a single character present in the list below
[A-Z]
{1} matches the previous token exactly one time (meaningless quantifier)
A-Z matches a single character in the range between A (index 65) and Z (index 90) (case sensitive)
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/

Test String