Regular Expressions 101

Save & Share

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java 8

Function

  • Match
  • Substitution
  • List
  • Unit Tests (17)
/
^(?<weeks>\d{1,2})w\s(?<days>0?[0-6])d\s(?<hours>(?:0?|1|2(?=[0-3]))\d)h\s(?<minutes>(?:0?|[1-5])\d)m$
/
i
All the errors detected are listed below, from left to right, as they appear in the pattern.
? The preceding token is not quantifiable
? The preceding token is not quantifiable
? The preceding token is not quantifiable
? The preceding token is not quantifiable
Your regular expression does not match the subject string.

Regular Expression
No Match

/
/
i

Test String