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
"
(?:\\n)+
"
Non-capturing group
(?:\\n)+
+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)
\\ matches the character \ with index 9210 (5C16 or 1348) literally (case sensitive)
n matches the character n with index 11010 (6E16 or 1568) literally (case sensitive)
Your regular expression does not match the subject string.

Regular Expression
No Match

r"
"

Test String