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 (RE2)

Function

  • Match
  • Substitution
  • List
  • Unit Tests
/
^.*?(?=\d*\pL\d*\pL|$)
/
Au
^ asserts position at start of the string
.*?
matches any character, including unicode (except for line terminators)
*? Quantifier — Matches between zero and unlimited times, as few times as possible, expanding as needed (lazy)
Positive Lookahead
(?=\d*\pL\d*\pL|$)
Assert that the Regex below matches
1st Alternative
\d*\pL\d*\pL
\d*
matches a digit zero through nine in any script except ideographic scripts (equal to \p{Nd})
* Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
\pL matches any kind of letter from any language
\d*
matches a digit zero through nine in any script except ideographic scripts (equal to \p{Nd})
* Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
\pL matches any kind of letter from any language
2nd Alternative
$
$ 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
A modifier: Anchored. The pattern is forced to become anchored at the start of the search, or at the position of the last successful match, equal to a \G
u modifier: unicode. Pattern strings are treated as UTF-16. Also causes escape sequences to match unicode characters
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/
Au

Test String

Substitution

Processing...