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
/
node_modules\/(?!(react-native|my-project|react-native-button)\/)
/
gm
node_modules
matches the characters node_modules literally (case sensitive)
\/ matches the character / with index 4710 (2F16 or 578) literally (case sensitive)
Negative Lookahead
(?!(react-native|my-project|react-native-button)\/)
Assert that the Regex below does not match
1st Capturing Group
(react-native|my-project|react-native-button)
1st Alternative
react-native
react-native
matches the characters react-native literally (case sensitive)
2nd Alternative
my-project
my-project
matches the characters my-project literally (case sensitive)
3rd Alternative
react-native-button
react-native-button
matches the characters react-native-button literally (case sensitive)
\/ matches the character / with index 4710 (2F16 or 578) literally (case sensitive)
Global pattern flags
g modifier: global. All matches (don't return after first match)
m modifier: multi line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string)
Your regular expression does not match the subject string.

Regular Expression
No Match

/
/
gm

Test String