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
"
^(?:\"Flesh)|^(?:\"Primitive)|^(?:\"Mutant)|^(?:\"Sacred)|^(?:\"Super)|^(?:\"Meat of)
"
gm
1st Alternative
^(?:\"Flesh)
^ asserts position at start of a line
Non-capturing group
(?:\"Flesh)
\" matches the character " with index 3410 (2216 or 428) literally (case sensitive)
Flesh
matches the characters Flesh literally (case sensitive)
2nd Alternative
^(?:\"Primitive)
^ asserts position at start of a line
Non-capturing group
(?:\"Primitive)
\" matches the character " with index 3410 (2216 or 428) literally (case sensitive)
Primitive
matches the characters Primitive literally (case sensitive)
3rd Alternative
^(?:\"Mutant)
^ asserts position at start of a line
Non-capturing group
(?:\"Mutant)
\" matches the character " with index 3410 (2216 or 428) literally (case sensitive)
Mutant
matches the characters Mutant literally (case sensitive)
4th Alternative
^(?:\"Sacred)
^ asserts position at start of a line
Non-capturing group
(?:\"Sacred)
\" matches the character " with index 3410 (2216 or 428) literally (case sensitive)
Sacred
matches the characters Sacred literally (case sensitive)
5th Alternative
^(?:\"Super)
^ asserts position at start of a line
Non-capturing group
(?:\"Super)
\" matches the character " with index 3410 (2216 or 428) literally (case sensitive)
Super
matches the characters Super literally (case sensitive)
6th Alternative
^(?:\"Meat of)
^ asserts position at start of a line
Non-capturing group
(?:\"Meat of)
\" matches the character " with index 3410 (2216 or 428) literally (case sensitive)
Meat of
matches the characters Meat of 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

r"
"
gm

Test String