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
/
((?:(?:gir)|(?:[a-pr-uwyz])(?:(?:[0-9](?:[a-hjkpstuw]|[0-9])?)|(?:[a-hk-y][0-9](?:[0-9]|[abehmnprv-y])?)))) ?([0-9][{2}abd-hjlnp-uw-z])
/
gm
1st Capturing Group
((?:(?:gir)|(?:[a-pr-uwyz])(?:(?:[0-9](?:[a-hjkpstuw]|[0-9])?)|(?:[a-hk-y][0-9](?:[0-9]|[abehmnprv-y])?))))
Non-capturing group
(?:(?:gir)|(?:[a-pr-uwyz])(?:(?:[0-9](?:[a-hjkpstuw]|[0-9])?)|(?:[a-hk-y][0-9](?:[0-9]|[abehmnprv-y])?)))
1st Alternative
(?:gir)
Non-capturing group
(?:gir)
gir matches the characters gir literally (case sensitive)
2nd Alternative
(?:[a-pr-uwyz])(?:(?:[0-9](?:[a-hjkpstuw]|[0-9])?)|(?:[a-hk-y][0-9](?:[0-9]|[abehmnprv-y])?))
Non-capturing group
(?:[a-pr-uwyz])
Match a single character present in the list below
[a-pr-uwyz]
a-p matches a single character in the range between a (index 97) and p (index 112) (case sensitive)
r-u matches a single character in the range between r (index 114) and u (index 117) (case sensitive)
wyz matches a single character in the list wyz (case sensitive)
Non-capturing group
(?:(?:[0-9](?:[a-hjkpstuw]|[0-9])?)|(?:[a-hk-y][0-9](?:[0-9]|[abehmnprv-y])?))
1st Alternative
(?:[0-9](?:[a-hjkpstuw]|[0-9])?)
Non-capturing group
(?:[0-9](?:[a-hjkpstuw]|[0-9])?)
Match a single character present in the list below
[0-9]
Non-capturing group
(?:[a-hjkpstuw]|[0-9])?
2nd Alternative
(?:[a-hk-y][0-9](?:[0-9]|[abehmnprv-y])?)
Non-capturing group
(?:[a-hk-y][0-9](?:[0-9]|[abehmnprv-y])?)
matches the character literally (case sensitive)
? matches the previous token between zero and one times, as many times as possible, giving back as needed (greedy)
2nd Capturing Group
([0-9][{2}abd-hjlnp-uw-z])
Match a single character present in the list below
[0-9]
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
[abd-hjlnp-uw-z]
{2} matches the previous token exactly 2 times
ab matches a single character in the list ab (case sensitive)
d-h matches a single character in the range between d (index 100) and h (index 104) (case sensitive)
jln matches a single character in the list jln (case sensitive)
p-u matches a single character in the range between p (index 112) and u (index 117) (case sensitive)
w-z matches a single character in the range between w (index 119) and z (index 122) (case sensitive)
Global pattern flags
g modifier: global. All matches (don't return after first match)
m modifier: multi line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string)
Your regular expression does not match the subject string.

Regular Expression
No Match

/
/
gm

Test String