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
/
(?ix)(?![AD-ZC][a-jn-zjm]) ( ([[:upper:]]) [[:lower:]] ) (?=[a-z]) (?!b-z) (.) ck ( (?!\t\r\n\f) \s ) ( (?=[A-Z]) (?![A-R]) (?![T-Z]) .\3\2\2\3t ( (h) ) ) \4\-\4\5\4\1 (o) (\8) d (?![xa-wz]) [[:alpha:]]\4\5
/
(?ix)
match the remainder of the pattern with the following effective flags: ix
i modifier: insensitive. Case insensitive match (ignores case of [a-zA-Z])
x modifier: extended. Spaces and text after a # in the pattern are ignored
Negative Lookahead
(?![AD-ZC][a-jn-zjm])
Assert that the Regex below does not match
Match a single character present in the list below
[AD-ZC]
A matches the character A literally (case insensitive)
D-Z matches a single character in the range between D (index 68) and Z (index 90) (case insensitive)
C matches the character C literally (case insensitive)
Match a single character present in the list below
[a-jn-zjm]
a-j matches a single character in the range between a (index 97) and j (index 106) (case insensitive)
n-z matches a single character in the range between n (index 110) and z (index 122) (case insensitive)
jm matches a single character in the list jm (case insensitive)
1st Capturing Group
( ([[:upper:]]) [[:lower:]] )
2nd Capturing Group
([[:upper:]])
Match a single character present in the list below
[[:upper:]]
[:upper:] matches a uppercase letter [A-Z]
Match a single character present in the list below
[[:lower:]]
[:lower:] matches a lowercase letter [a-z]
Positive Lookahead
(?=[a-z])
Assert that the Regex below matches
Match a single character present in the list below
[a-z]
a-z matches a single character in the range between a (index 97) and z (index 122) (case insensitive)
Negative Lookahead
(?!b-z)
Assert that the Regex below does not match
b-z matches the characters b-z literally (case insensitive)
3rd Capturing Group
(.)
ck matches the characters ck literally (case insensitive)
4th Capturing Group
( (?!\t\r\n\f) \s )
5th Capturing Group
( (?=[A-Z]) (?![A-R]) (?![T-Z]) .\3\2\2\3t ( (h) ) )
\4 matches the same text as most recently matched by the 4th capturing group
\- matches the character - literally (case insensitive)
\4 matches the same text as most recently matched by the 4th capturing group
\5 matches the same text as most recently matched by the 5th capturing group
\4 matches the same text as most recently matched by the 4th capturing group
\1 matches the same text as most recently matched by the 1st capturing group
8th Capturing Group
(o)
9th Capturing Group
(\8)
d matches the character d literally (case insensitive)
Negative Lookahead
(?![xa-wz])
Assert that the Regex below does not match
Match a single character present in the list below
[[:alpha:]]
\4 matches the same text as most recently matched by the 4th capturing group
\5
matches the same text as most recently matched by the 5th capturing group
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/

Test String