Regular Expressions 101

Save & Share

  • Save Regex
    ctrl+s
  • Update Regex
    ctrl+⇧+s

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java 8

Function

  • Match
  • Substitution
  • List
  • Unit Tests
"
([023]3|[067]0|[1289]1|5[5689]|67|96|88|77|65|05)$|^(8|4[358]|7[147]|51|37|30)|865|349|2.{5}5|761|74[348]|728|811|990
"
gm
1st Alternative
([023]3|[067]0|[1289]1|5[5689]|67|96|88|77|65|05)$
1st Capturing Group
([023]3|[067]0|[1289]1|5[5689]|67|96|88|77|65|05)
1st Alternative
[023]3
Match a single character present in the list below
[023]
023
matches a single character in the list 023 (case sensitive)
3 matches the character 3 with index 5110 (3316 or 638) literally (case sensitive)
2nd Alternative
[067]0
Match a single character present in the list below
[067]
067
matches a single character in the list 067 (case sensitive)
0 matches the character 0 with index 4810 (3016 or 608) literally (case sensitive)
3rd Alternative
[1289]1
Match a single character present in the list below
[1289]
1289
matches a single character in the list 1289 (case sensitive)
1 matches the character 1 with index 4910 (3116 or 618) literally (case sensitive)
4th Alternative
5[5689]
5 matches the character 5 with index 5310 (3516 or 658) literally (case sensitive)
Match a single character present in the list below
[5689]
5689
matches a single character in the list 5689 (case sensitive)
5th Alternative
67
67
matches the characters 67 literally (case sensitive)
6th Alternative
96
96
matches the characters 96 literally (case sensitive)
7th Alternative
88
88
matches the characters 88 literally (case sensitive)
8th Alternative
77
77
matches the characters 77 literally (case sensitive)
9th Alternative
65
65
matches the characters 65 literally (case sensitive)
10th Alternative
05
05
matches the characters 05 literally (case sensitive)
$ asserts position at the end of a line
2nd Alternative
^(8|4[358]|7[147]|51|37|30)
^ asserts position at start of a line
2nd Capturing Group
(8|4[358]|7[147]|51|37|30)
1st Alternative
8
8 matches the character 8 with index 5610 (3816 or 708) literally (case sensitive)
2nd Alternative
4[358]
4 matches the character 4 with index 5210 (3416 or 648) literally (case sensitive)
Match a single character present in the list below
[358]
358
matches a single character in the list 358 (case sensitive)
3rd Alternative
7[147]
7 matches the character 7 with index 5510 (3716 or 678) literally (case sensitive)
Match a single character present in the list below
[147]
147
matches a single character in the list 147 (case sensitive)
4th Alternative
51
51
matches the characters 51 literally (case sensitive)
5th Alternative
37
37
matches the characters 37 literally (case sensitive)
6th Alternative
30
30
matches the characters 30 literally (case sensitive)
3rd Alternative
865
865
matches the characters 865 literally (case sensitive)
4th Alternative
349
349
matches the characters 349 literally (case sensitive)
5th Alternative
2.{5}5
2 matches the character 2 with index 5010 (3216 or 628) literally (case sensitive)
.
matches any character (except for line terminators)
{5} matches the previous token exactly 5 times
5 matches the character 5 with index 5310 (3516 or 658) literally (case sensitive)
6th Alternative
761
761
matches the characters 761 literally (case sensitive)
7th Alternative
74[348]
74
matches the characters 74 literally (case sensitive)
Match a single character present in the list below
[348]
348
matches a single character in the list 348 (case sensitive)
8th Alternative
728
728
matches the characters 728 literally (case sensitive)
9th Alternative
811
811
matches the characters 811 literally (case sensitive)
10th Alternative
990
990
matches the characters 990 literally (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

r"
"
gm

Test String