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
/
\b(?<=\d|^)(?!$)
/
g
\b assert position at a word boundary: (^\w|\w$|\W\w|\w\W)
Positive Lookbehind
(?<=\d|^)
Assert that the Regex below matches
1st Alternative
\d
\d matches a digit (equivalent to [0-9])
2nd Alternative
^
^ asserts position at start of the string
Negative Lookahead
(?!$)
Assert that the Regex below does not match
$ asserts position at the end of the string, or before the line terminator right at the end of the string (if any)
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