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
/
\b\w|(?<=\p{Ll})\p{Lu}
/
g
1st Alternative
\b\w
\b assert position at a word boundary: (^\w|\w$|\W\w|\w\W)
\w matches any word character (equivalent to [a-zA-Z0-9_])
2nd Alternative
(?<=\p{Ll})\p{Lu}
Positive Lookbehind
(?<=\p{Ll})
Assert that the Regex below matches
\p{Ll} matches a lowercase letter that has an uppercase variant
\p{Lu} matches an uppercase letter that has a lowercase variant
Global pattern flags
g modifier: global. All matches (don't return after first match)
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/
g

Test String