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 (RE2)

Function

  • Match
  • Substitution
  • List
  • Unit Tests
/
([АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx]\s*\d{3}\s*[АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx]{2}\s*\d{2,3})|([АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx]{2}\s*\d{3}\s*\d{2,3})
/
gm
1st Alternative
([АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx]\s*\d{3}\s*[АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx]{2}\s*\d{2,3})
1st Capturing Group
([АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx]\s*\d{3}\s*[АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx]{2}\s*\d{2,3})
Match a single character present in the list below
[АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx]
АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx matches a single character in the list АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx (case sensitive)
\s*
matches any whitespace character (equal to [\r\n\t\f\v ])
* Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
\d{3}
matches a digit (equal to [0-9])
{3} Quantifier — Matches exactly 3 times
\s*
matches any whitespace character (equal to [\r\n\t\f\v ])
* Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
Match a single character present in the list below
[АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx]{2}
{2} Quantifier — Matches exactly 2 times
АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx matches a single character in the list АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx (case sensitive)
\s*
matches any whitespace character (equal to [\r\n\t\f\v ])
* Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
\d{2,3}
matches a digit (equal to [0-9])
{2,3} Quantifier — Matches between 2 and 3 times, as many times as possible, giving back as needed (greedy)
2nd Alternative
([АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx]{2}\s*\d{3}\s*\d{2,3})
2nd Capturing Group
([АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx]{2}\s*\d{3}\s*\d{2,3})
Match a single character present in the list below
[АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx]{2}
{2} Quantifier — Matches exactly 2 times
АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx matches a single character in the list АВЕКМНОРСТУХавекмнорстухABEKMHOPCTYXabekmhopctyx (case sensitive)
\s*
matches any whitespace character (equal to [\r\n\t\f\v ])
* Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
\d{3}
matches a digit (equal to [0-9])
{3} Quantifier — Matches exactly 3 times
\s*
matches any whitespace character (equal to [\r\n\t\f\v ])
* Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
\d{2,3}
matches a digit (equal to [0-9])
{2,3} Quantifier — Matches between 2 and 3 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)
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.Try launching the debugger to find out why.

Regular Expression
No Match

/
/
gm

Test String