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
/
(?:[0-9]|[1-9][0-9]|10[0-9]|11[01])\.(?:\h[a-h][1-8]){1,2}\h
/
g
Non-capturing group
(?:[0-9]|[1-9][0-9]|10[0-9]|11[01])
1st Alternative
[0-9]
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)
2nd Alternative
[1-9][0-9]
Match a single character present in the list below
[1-9]
1-9 matches a single character in the range between 1 (index 49) and 9 (index 57) (case sensitive)
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)
3rd Alternative
10[0-9]
10 matches the characters 10 literally (case sensitive)
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)
4th Alternative
11[01]
11 matches the characters 11 literally (case sensitive)
Match a single character present in the list below
[01]
01 matches a single character in the list 01 (case sensitive)
\. matches the character . literally (case sensitive)
Non-capturing group
(?:\h[a-h][1-8]){1,2}
{1,2} matches the previous token between 1 and 2 times, as many times as possible, giving back as needed (greedy)
\h matches any horizontal whitespace character (equivalent to [[:blank:]])
Match a single character present in the list below
[a-h]
a-h matches a single character in the range between a (index 97) and h (index 104) (case sensitive)
Match a single character present in the list below
[1-8]
1-8 matches a single character in the range between 1 (index 49) and 8 (index 56) (case sensitive)
\h
matches any horizontal whitespace character (equivalent to [[:blank:]])
? matches the previous token between zero and one times, as many times as possible, giving back as needed (greedy)
Global pattern flags
g modifier: global. All matches (don't return after first match)
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/
g

Test String