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
`
\s([a-zA-Z]+://)*(\b([a-zA-Z][\w-]*\.){1,3}[a-zA-Z0-9]+|(\b((2[0-4]\d|25[0-5]|1\d\d|0\d\d|0\d|\d\d|\d)\.){3}(2[0-4]\d|25[0-5]|1\d\d|0\d\d|0\d|\d\d|\d)\b))(:\d+)*([\\\!\"\#\$\%\&\'\(\)\*\+\-\/\:\;\<\=\>\?\@\[\]\^\`\{\|\}\~\.\w])*(\,.+\.[a-z]+)*
`
g
All the errors detected are listed below, from left to right, as they appear in the pattern.
\` Backticks can not be used in a raw string, use \x60 instead
Your regular expression does not match the subject string.

Regular Expression
No Match

`
`
g

Test String