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
/
\-(moz|o|webkit|ms|khtml)\-(?!font-smoothing|osx|print).+?;
/
g
\- matches the character - with index 4510 (2D16 or 558) literally (case sensitive)
1st Capturing Group
(moz|o|webkit|ms|khtml)
1st Alternative
moz
moz
matches the characters moz literally (case sensitive)
2nd Alternative
o
o matches the character o with index 11110 (6F16 or 1578) literally (case sensitive)
3rd Alternative
webkit
webkit
matches the characters webkit literally (case sensitive)
4th Alternative
ms
ms
matches the characters ms literally (case sensitive)
5th Alternative
khtml
khtml
matches the characters khtml literally (case sensitive)
\- matches the character - with index 4510 (2D16 or 558) literally (case sensitive)
Negative Lookahead
(?!font-smoothing|osx|print)
Assert that the Regex below does not match
1st Alternative
font-smoothing
font-smoothing
matches the characters font-smoothing literally (case sensitive)
2nd Alternative
osx
osx
matches the characters osx literally (case sensitive)
3rd Alternative
print
print
matches the characters print literally (case sensitive)
.
matches any character (except for line terminators)
+? matches the previous token between one and unlimited times, as few times as possible, expanding as needed (lazy)
; matches the character ; with index 5910 (3B16 or 738) literally (case sensitive)
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