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
/
(?<=[^\s?.;]\h)pression(?=\h[^\s?.;])
/
i
Positive Lookbehind
(?<=[^\s?.;]\h)
Assert that the Regex below matches
Match a single character not present in the list below
[^\s?.;]
\s matches any whitespace character (equivalent to [\r\n\t\f\v ])
?.;
matches a single character in the list ?.; (case insensitive)
\h matches any horizontal whitespace character (equivalent to [[:blank:]])
pression
matches the characters pression literally (case insensitive)
Positive Lookahead
(?=\h[^\s?.;])
Assert that the Regex below matches
\h matches any horizontal whitespace character (equivalent to [[:blank:]])
Match a single character not present in the list below
[^\s?.;]
\s matches any whitespace character (equivalent to [\r\n\t\f\v ])
?.;
matches a single character in the list ?.; (case insensitive)
Global pattern flags
i modifier: insensitive. Case insensitive match (ignores case of [a-zA-Z])
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/
i

Test String