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
/
(?:(?:\"|'|\]|\}|\\|\d|(?:nan|infinity|true|false|null|undefined|symbol|math)|\`|\-|\+)+[)]*;?((?:\s|-|~|!|{}|\|\||\+)*.*(?:.*=.*)))
/
gm
Non-capturing group
(?:(?:\"|'|\]|\}|\\|\d|(?:nan|infinity|true|false|null|undefined|symbol|math)|\`|\-|\+)+[)]*;?((?:\s|-|~|!|{}|\|\||\+)*.*(?:.*=.*)))
Non-capturing group
(?:\"|'|\]|\}|\\|\d|(?:nan|infinity|true|false|null|undefined|symbol|math)|\`|\-|\+)+
+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)
1st Alternative
\"
\" matches the character " with index 3410 (2216 or 428) literally (case sensitive)
2nd Alternative
'
' matches the character ' with index 3910 (2716 or 478) literally (case sensitive)
3rd Alternative
\]
\] matches the character ] with index 9310 (5D16 or 1358) literally (case sensitive)
4th Alternative
\}
\} matches the character } with index 12510 (7D16 or 1758) literally (case sensitive)
5th Alternative
\\
\\ matches the character \ with index 9210 (5C16 or 1348) literally (case sensitive)
6th Alternative
\d
\d matches a digit (equivalent to [0-9])
7th Alternative
(?:nan|infinity|true|false|null|undefined|symbol|math)
Non-capturing group
(?:nan|infinity|true|false|null|undefined|symbol|math)
1st Alternative
nan
nan
matches the characters nan literally (case sensitive)
2nd Alternative
infinity
infinity
matches the characters infinity literally (case sensitive)
3rd Alternative
true
true
matches the characters true literally (case sensitive)
4th Alternative
false
false
matches the characters false literally (case sensitive)
5th Alternative
null
null
matches the characters null literally (case sensitive)
6th Alternative
undefined
7th Alternative
symbol
8th Alternative
math
8th Alternative
\`
\` matches the character ` with index 9610 (6016 or 1408) literally (case sensitive)
9th Alternative
\-
\- matches the character - with index 4510 (2D16 or 558) literally (case sensitive)
10th Alternative
\+
\+ matches the character + with index 4310 (2B16 or 538) literally (case sensitive)
Match a single character present in the list below
[)]
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
) matches the character ) with index 4110 (2916 or 518) literally (case sensitive)
;
matches the character ; with index 5910 (3B16 or 738) literally (case sensitive)
1st Capturing Group
((?:\s|-|~|!|{}|\|\||\+)*.*(?:.*=.*))
Non-capturing group
(?:\s|-|~|!|{}|\|\||\+)*
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
1st Alternative
\s
\s matches any whitespace character (equivalent to [\r\n\t\f\v \u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff])
2nd Alternative
-
- matches the character - with index 4510 (2D16 or 558) literally (case sensitive)
3rd Alternative
~
~ matches the character ~ with index 12610 (7E16 or 1768) literally (case sensitive)
4th Alternative
!
! matches the character ! with index 3310 (2116 or 418) literally (case sensitive)
5th Alternative
{}
{}
matches the characters {} literally (case sensitive)
6th Alternative
\|\|
\| matches the character | with index 12410 (7C16 or 1748) literally (case sensitive)
\| matches the character | with index 12410 (7C16 or 1748) literally (case sensitive)
7th Alternative
\+
\+ matches the character + with index 4310 (2B16 or 538) literally (case sensitive)
.
matches any character (except for line terminators)
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
Non-capturing group
(?:.*=.*)
.
matches any character (except for line terminators)
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
= matches the character = with index 6110 (3D16 or 758) literally (case sensitive)
.
matches any character (except for line terminators)
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
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