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
/
[P][Z][N][:]["]([0-9]+)["]
/
Match a single character present in the list below
[P]
P matches the character P with index 8010 (5016 or 1208) literally (case sensitive)
Match a single character present in the list below
[Z]
Z matches the character Z with index 9010 (5A16 or 1328) literally (case sensitive)
Match a single character present in the list below
[N]
N matches the character N with index 7810 (4E16 or 1168) literally (case sensitive)
Match a single character present in the list below
[:]
: matches the character : with index 5810 (3A16 or 728) literally (case sensitive)
Match a single character present in the list below
["]
" matches the character " with index 3410 (2216 or 428) literally (case sensitive)
1st Capturing Group
([0-9]+)
Match a single character present in the list below
[0-9]
+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)
0-9 matches a single character in the range between 0 (index 48) and 9 (index 57) (case sensitive)
Match a single character present in the list below
["]
" matches the character " with index 3410 (2216 or 428) literally (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