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
/
bu|[rn]t|[coy]e|[mtg]a|j|iso|n[hl]|[ae]d|lev|sh|[lnd]i|[po]o|ls
/
1st Alternative
bu
bu
matches the characters bu literally (case sensitive)
2nd Alternative
[rn]t
Match a single character present in the list below
[rn]
rn
matches a single character in the list rn (case sensitive)
t matches the character t with index 11610 (7416 or 1648) literally (case sensitive)
3rd Alternative
[coy]e
Match a single character present in the list below
[coy]
coy
matches a single character in the list coy (case sensitive)
e matches the character e with index 10110 (6516 or 1458) literally (case sensitive)
4th Alternative
[mtg]a
Match a single character present in the list below
[mtg]
mtg
matches a single character in the list mtg (case sensitive)
a matches the character a with index 9710 (6116 or 1418) literally (case sensitive)
5th Alternative
j
j matches the character j with index 10610 (6A16 or 1528) literally (case sensitive)
6th Alternative
iso
iso
matches the characters iso literally (case sensitive)
7th Alternative
n[hl]
n matches the character n with index 11010 (6E16 or 1568) literally (case sensitive)
Match a single character present in the list below
[hl]
hl
matches a single character in the list hl (case sensitive)
8th Alternative
[ae]d
Match a single character present in the list below
[ae]
ae
matches a single character in the list ae (case sensitive)
d matches the character d with index 10010 (6416 or 1448) literally (case sensitive)
9th Alternative
lev
lev
matches the characters lev literally (case sensitive)
10th Alternative
sh
sh
matches the characters sh literally (case sensitive)
11th Alternative
[lnd]i
Match a single character present in the list below
[lnd]
lnd
matches a single character in the list lnd (case sensitive)
i matches the character i with index 10510 (6916 or 1518) literally (case sensitive)
12th Alternative
[po]o
13th Alternative
ls
Your regular expression does not match the subject string.

Regular Expression
No Match

/
/

Test String