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
/
(-100x)([0-9]*)(\.(gif|jpg|png))
/
1st Capturing Group
(-100x)
-100x
matches the characters -100x literally (case sensitive)
2nd Capturing Group
([0-9]*)
Match a single character present in the list below
[0-9]
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
0-9 matches a single character in the range between 0 (index 48) and 9 (index 57) (case sensitive)
3rd Capturing Group
(\.(gif|jpg|png))
\. matches the character . with index 4610 (2E16 or 568) literally (case sensitive)
4th Capturing Group
(gif|jpg|png)
1st Alternative
gif
gif
matches the characters gif literally (case sensitive)
2nd Alternative
jpg
jpg
matches the characters jpg literally (case sensitive)
3rd Alternative
png
png
matches the characters png literally (case sensitive)
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/

Test String