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
/
(?|\((?<txt>[^)]+)\)\[(?<url>https?://(?:www\.)?(?:(?:(?:(?:en|ru|de|pt-br|fr|pl|zh-tw|nl|es|images|maps|video|news|shopping|photos|plus|profiles|books|finance|scholar|bing|snopes|wikipedia)\.)?lmgtfy|lm(?:b|sp|s)tfy)\.com|lmddgtfy\.net))\])|((\g<url>))
/
gi
All the errors detected are listed below, from left to right, as they appear in the pattern.
/ An unescaped delimiter must be escaped with a backslash (\)
/ An unescaped delimiter must be escaped with a backslash (\)
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/
gi

Test String