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
"
^(ssh-rsa) (?!toto)
"
^ asserts position at start of the string
1st Capturing Group
(ssh-rsa)
ssh-rsa
matches the characters ssh-rsa literally (case sensitive)
matches the character with index 3210 (2016 or 408) literally (case sensitive)
Negative Lookahead
(?!toto)
Assert that the Regex below does not match
toto
matches the characters toto literally (case sensitive)
Your regular expression does not match the subject string.

Regular Expression
No Match

r"
"

Test String

Substitution

Processing...