Regular Expressions 101

@regex101
Donate
Sponsor
Contact
Bug Reports & Feedback
Wiki
Whats new?

Save & Share

  • Save Regex
    ctrl+s
  • Update Regex
    ctrl+⇧+s

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python 2.7
  • Golang (RE2)

Function

  • Match
  • Substitution
  • List
  • Unit Tests
/
\s*([a-z\-]+)\s+(\.[a-z_]+):([nNpTFwcVvxof]*)\s+=
/
g
\s*
matches any whitespace character (equal to [\r\n\t\f\v ])
* Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
1st Capturing Group
([a-z\-]+)
Match a single character present in the list below
[a-z\-]+
+ Quantifier — Matches between one and unlimited times, as many times as possible, giving back as needed (greedy)
a-z a single character in the range between a (index 97) and z (index 122) (case sensitive)
\- matches the character - literally (case sensitive)
\s+
matches any whitespace character (equal to [\r\n\t\f\v ])
+ Quantifier — Matches between one and unlimited times, as many times as possible, giving back as needed (greedy)
2nd Capturing Group
(\.[a-z_]+)
\. matches the character . literally (case sensitive)
Match a single character present in the list below
[a-z_]+
+ Quantifier — Matches between one and unlimited times, as many times as possible, giving back as needed (greedy)
a-z a single character in the range between a (index 97) and z (index 122) (case sensitive)
_ matches the character _ literally (case sensitive)
: matches the character : literally (case sensitive)
3rd Capturing Group
([nNpTFwcVvxof]*)
Match a single character present in the list below
[nNpTFwcVvxof]*
* Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
nNpTFwcVvxof matches a single character in the list nNpTFwcVvxof (case sensitive)
\s+
matches any whitespace character (equal to [\r\n\t\f\v ])
+ Quantifier — Matches between one and unlimited times, as many times as possible, giving back as needed (greedy)
= matches the character = 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