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
/
^http:\/\/cheqroom.com\/qr\/([a-z0-9]{8})$
/
i
^ asserts position at start of the string
http:
matches the characters http: literally (case insensitive)
\/ matches the character / with index 4710 (2F16 or 578) literally (case insensitive)
\/ matches the character / with index 4710 (2F16 or 578) literally (case insensitive)
cheqroom
matches the characters cheqroom literally (case insensitive)
. matches any character (except for line terminators)
com
matches the characters com literally (case insensitive)
\/ matches the character / with index 4710 (2F16 or 578) literally (case insensitive)
qr
matches the characters qr literally (case insensitive)
\/ matches the character / with index 4710 (2F16 or 578) literally (case insensitive)
1st Capturing Group
([a-z0-9]{8})
Match a single character present in the list below
[a-z0-9]
{8} matches the previous token exactly 8 times
a-z matches a single character in the range between a (index 97) and z (index 122) (case insensitive)
0-9 matches a single character in the range between 0 (index 48) and 9 (index 57) (case insensitive)
$ asserts position at the end of the string, or before the line terminator right at the end of the string (if any)
Global pattern flags
i modifier: insensitive. Case insensitive match (ignores case of [a-zA-Z])
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match

/
/
i

Test String