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
"
(n\'t|\'m|\'ll|\'ve|\'s|\'re|\'d)
"
gm
1st Capturing Group
(n\'t|\'m|\'ll|\'ve|\'s|\'re|\'d)
1st Alternative
n\'t
n matches the character n with index 11010 (6E16 or 1568) literally (case sensitive)
\' matches the character ' with index 3910 (2716 or 478) literally (case sensitive)
t matches the character t with index 11610 (7416 or 1648) literally (case sensitive)
2nd Alternative
\'m
\' matches the character ' with index 3910 (2716 or 478) literally (case sensitive)
m matches the character m with index 10910 (6D16 or 1558) literally (case sensitive)
3rd Alternative
\'ll
\' matches the character ' with index 3910 (2716 or 478) literally (case sensitive)
ll
matches the characters ll literally (case sensitive)
4th Alternative
\'ve
\' matches the character ' with index 3910 (2716 or 478) literally (case sensitive)
ve
matches the characters ve literally (case sensitive)
5th Alternative
\'s
\' matches the character ' with index 3910 (2716 or 478) literally (case sensitive)
s matches the character s with index 11510 (7316 or 1638) literally (case sensitive)
6th Alternative
\'re
\' matches the character ' with index 3910 (2716 or 478) literally (case sensitive)
re
matches the characters re literally (case sensitive)
7th Alternative
\'d
\' matches the character ' with index 3910 (2716 or 478) literally (case sensitive)
d matches the character d with index 10010 (6416 or 1448) 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

Substitution

Processing...

Code Generator

Generated Code

Loading code sample...
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report.
For a full regex reference for Python, please visit: https://docs.python.org/3/library/re.html