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.)([07](?:[18](?2)|[29](?3)|3(?4)|4(?5)|5(?7)|6(?9)|$))|(5(?:[07](?4)|[18](?5)|[29](?7)|4(?1)|6(?3)|3(?9)))(3(?:[18](?1)|[29](?2)|[07](?9)|4(?4)|5(?5)|6(?7)))([18](?:[07](?3)|[29](?5)|5(?1)|6(?2)|3(?7)|4(?9)))(6([29](?1)|[07](?7)|[18](?9)|3(?2)|4(?3)|5(?4)))(4([07](?2)|[18](?3)|[29](?4)|6(?1)|3(?5)|5(?9)))([29]([07](?5)|[18](?7)|3(?1)|4(?2)|5(?3)|6(?4)))
/
1st Alternative
^(?!$|0.)([07](?:[18](?2)|[29](?3)|3(?4)|4(?5)|5(?7)|6(?9)|$))
^ asserts position at start of the string
Negative Lookahead
(?!$|0.)
Assert that the Regex below does not match
1st Alternative
$
$ asserts position at the end of the string, or before the line terminator right at the end of the string (if any)
2nd Alternative
0.
0 matches the character 0 literally (case sensitive)
. matches any character (except for line terminators)
1st Capturing Group
([07](?:[18](?2)|[29](?3)|3(?4)|4(?5)|5(?7)|6(?9)|$))
Match a single character present in the list below
[07]
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
07 matches a single character in the list 07 (case sensitive)
Non-capturing group
(?:[18](?2)|[29](?3)|3(?4)|4(?5)|5(?7)|6(?9)|$)
1st Alternative
[18](?2)
Match a single character present in the list below
[18]
18 matches a single character in the list 18 (case sensitive)
(?2) recurses the 2nd subpattern
2nd Alternative
[29](?3)
Match a single character present in the list below
[29]
29 matches a single character in the list 29 (case sensitive)
(?3) recurses the 3rd subpattern
3rd Alternative
3(?4)
3 matches the character 3 literally (case sensitive)
(?4) recurses the 4th subpattern
4th Alternative
4(?5)
5th Alternative
5(?7)
6th Alternative
6(?9)
7th Alternative
$
2nd Alternative
(5(?:[07](?4)|[18](?5)|[29](?7)|4(?1)|6(?3)|3(?9)))(3(?:[18](?1)|[29](?2)|[07](?9)|4(?4)|5(?5)|6(?7)))([18](?:[07](?3)|[29](?5)|5(?1)|6(?2)|3(?7)|4(?9)))(6([29](?1)|[07](?7)|[18](?9)|3(?2)|4(?3)|5(?4)))(4([07](?2)|[18](?3)|[29](?4)|6(?1)|3(?5)|5(?9)))([29]([07](?5)|[18](?7)|3(?1)|4(?2)|5(?3)|6(?4)))
2nd Capturing Group
(5(?:[07](?4)|[18](?5)|[29](?7)|4(?1)|6(?3)|3(?9)))
5
matches the character 5 literally (case sensitive)
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
Non-capturing group
(?:[07](?4)|[18](?5)|[29](?7)|4(?1)|6(?3)|3(?9))
1st Alternative
[07](?4)
Match a single character present in the list below
[07]
07 matches a single character in the list 07 (case sensitive)
(?4) recurses the 4th subpattern
2nd Alternative
[18](?5)
Match a single character present in the list below
[18]
18 matches a single character in the list 18 (case sensitive)
(?5) recurses the 5th subpattern
3rd Alternative
[29](?7)
Match a single character present in the list below
[29]
29 matches a single character in the list 29 (case sensitive)
(?7) recurses the 7th subpattern
4th Alternative
4(?1)
4 matches the character 4 literally (case sensitive)
(?1) recurses the 1st subpattern
5th Alternative
6(?3)
6th Alternative
3(?9)
3rd Capturing Group
(3(?:[18](?1)|[29](?2)|[07](?9)|4(?4)|5(?5)|6(?7)))
3
matches the character 3 literally (case sensitive)
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
Non-capturing group
(?:[18](?1)|[29](?2)|[07](?9)|4(?4)|5(?5)|6(?7))
1st Alternative
[18](?1)
Match a single character present in the list below
[18]
18 matches a single character in the list 18 (case sensitive)
(?1) recurses the 1st subpattern
2nd Alternative
[29](?2)
Match a single character present in the list below
[29]
29 matches a single character in the list 29 (case sensitive)
(?2) recurses the 2nd subpattern
3rd Alternative
[07](?9)
Match a single character present in the list below
[07]
(?9) recurses the 9th subpattern
4th Alternative
4(?4)
5th Alternative
5(?5)
6th Alternative
6(?7)
4th Capturing Group
([18](?:[07](?3)|[29](?5)|5(?1)|6(?2)|3(?7)|4(?9)))
Match a single character present in the list below
[18]
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
18 matches a single character in the list 18 (case sensitive)
Non-capturing group
(?:[07](?3)|[29](?5)|5(?1)|6(?2)|3(?7)|4(?9))
1st Alternative
[07](?3)
Match a single character present in the list below
[07]
07 matches a single character in the list 07 (case sensitive)
(?3) recurses the 3rd subpattern
2nd Alternative
[29](?5)
Match a single character present in the list below
[29]
(?5) recurses the 5th subpattern
3rd Alternative
5(?1)
4th Alternative
6(?2)
5th Alternative
3(?7)
6th Alternative
4(?9)
5th Capturing Group
(6([29](?1)|[07](?7)|[18](?9)|3(?2)|4(?3)|5(?4)))
6
matches the character 6 literally (case sensitive)
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
6th Capturing Group
([29](?1)|[07](?7)|[18](?9)|3(?2)|4(?3)|5(?4))
1st Alternative
[29](?1)
Match a single character present in the list below
[29]
(?1) recurses the 1st subpattern
2nd Alternative
[07](?7)
3rd Alternative
[18](?9)
4th Alternative
3(?2)
5th Alternative
4(?3)
6th Alternative
5(?4)
7th Capturing Group
(4([07](?2)|[18](?3)|[29](?4)|6(?1)|3(?5)|5(?9)))
4
matches the character 4 literally (case sensitive)
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
8th Capturing Group
([07](?2)|[18](?3)|[29](?4)|6(?1)|3(?5)|5(?9))
1st Alternative
[07](?2)
2nd Alternative
[18](?3)
3rd Alternative
[29](?4)
4th Alternative
6(?1)
5th Alternative
3(?5)
6th Alternative
5(?9)
9th Capturing Group
([29]([07](?5)|[18](?7)|3(?1)|4(?2)|5(?3)|6(?4)))
Match a single character present in the list below
[29]
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
29 matches a single character in the list 29 (case sensitive)
10th Capturing Group
([07](?5)|[18](?7)|3(?1)|4(?2)|5(?3)|6(?4))
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/

Test String