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
/
^http(s):\/\/(www\.google.com|google\.com|88n8\.com|second\.88n8\.com|third\.88n8\.com|fourth\.88n8\.com)$
/
gm
^ asserts position at start of a line
http matches the characters http literally (case sensitive)
1st Capturing Group
(s)
s matches the character s literally (case sensitive)
: matches the character : literally (case sensitive)
\/ matches the character / literally (case sensitive)
\/ matches the character / literally (case sensitive)
2nd Capturing Group
(www\.google.com|google\.com|88n8\.com|second\.88n8\.com|third\.88n8\.com|fourth\.88n8\.com)
1st Alternative
www\.google.com
www matches the characters www literally (case sensitive)
\. matches the character . literally (case sensitive)
google matches the characters google literally (case sensitive)
. matches any character (except for line terminators)
com matches the characters com literally (case sensitive)
2nd Alternative
google\.com
google matches the characters google literally (case sensitive)
\. matches the character . literally (case sensitive)
com matches the characters com literally (case sensitive)
3rd Alternative
88n8\.com
4th Alternative
second\.88n8\.com
5th Alternative
third\.88n8\.com
6th Alternative
fourth\.88n8\.com
$ asserts position at the end of a line
Global pattern flags
g modifier: global. All matches (don't return after first match)
m modifier: multi line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string)
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/
gm

Test String

Substitution

Processing...