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
/
(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})
/
Named Capture Group year
(?<year>\d{4})
\d
matches a digit (equivalent to [0-9])
{4} matches the previous token exactly 4 times
- matches the character - with index 4510 (2D16 or 558) literally (case sensitive)
Named Capture Group month
(?<month>\d{2})
\d
matches a digit (equivalent to [0-9])
{2} matches the previous token exactly 2 times
- matches the character - with index 4510 (2D16 or 558) literally (case sensitive)
Named Capture Group day
(?<day>\d{2})
\d
matches a digit (equivalent to [0-9])
{2} matches the previous token exactly 2 times
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/

Test String