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
"
([0-9]{1,2}\s+d\s?e?\s+\&?\&?[a--ü]{4,9}\s+[0-9]{4}\,?\s?([àa]s\s+)?\&?\&?[0-9]{2}(:|h|h:)[0-9]{2})
"
g
1st Capturing Group
([0-9]{1,2}\s+d\s?e?\s+\&?\&?[a--ü]{4,9}\s+[0-9]{4}\,?\s?([àa]s\s+)?\&?\&?[0-9]{2}(:|h|h:)[0-9]{2})
Match a single character present in the list below
[0-9]
{1,2} matches the previous token between 1 and 2 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)
\s
matches any whitespace character (equivalent to [\r\n\t\f\v  ])
+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)
d matches the character d with index 10010 (6416 or 1448) literally (case sensitive)
\s
matches any whitespace character (equivalent to [\r\n\t\f\v  ])
? matches the previous token between zero and one times, as many times as possible, giving back as needed (greedy)
e
matches the character e with index 10110 (6516 or 1458) literally (case sensitive)
\s
matches any whitespace character (equivalent to [\r\n\t\f\v  ])
+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)
\&
matches the character & with index 3810 (2616 or 468) literally (case sensitive)
? matches the previous token between zero and one times, as many times as possible, giving back as needed (greedy)
\&
matches the character & with index 3810 (2616 or 468) literally (case sensitive)
? matches the previous token between zero and one times, as many times as possible, giving back as needed (greedy)
Match a single character present in the list below
[a--ü]
{4,9} matches the previous token between 4 and 9 times, as many times as possible, giving back as needed (greedy)
a-z matches a single character in the range between a (index 97) and z (index 122) (case sensitive)
à-ü matches a single character in the range between à (index 224) and ü (index 252) (case sensitive)
\s
matches any whitespace character (equivalent to [\r\n\t\f\v  ])
+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)
Match a single character present in the list below
[0-9]
{4} matches the previous token exactly 4 times
0-9 matches a single character in the range between 0 (index 48) and 9 (index 57) (case sensitive)
\,
matches the character , with index 4410 (2C16 or 548) literally (case sensitive)
? matches the previous token between zero and one times, as many times as possible, giving back as needed (greedy)
\s
matches any whitespace character (equivalent to [\r\n\t\f\v  ])
2nd Capturing Group
([àa]s\s+)?
\&
matches the character & with index 3810 (2616 or 468) literally (case sensitive)
\&
matches the character & with index 3810 (2616 or 468) literally (case sensitive)
Match a single character present in the list below
[0-9]
3rd Capturing Group
(:|h|h:)
Match a single character present in the list below
[0-9]
Global pattern flags
g modifier: global. All matches (don't return after first match)
Your regular expression does not match the subject string.

Regular Expression
No Match

r"
"
g

Test String