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
"
(Apto Prof\.?e?s?i?o?n?a?l?)
"
gmi
1st Capturing Group
(Apto Prof\.?e?s?i?o?n?a?l?)
Apto Prof
matches the characters Apto Prof literally (case insensitive)
\.
matches the character . with index 4610 (2E16 or 568) literally (case insensitive)
? matches the previous token between zero and one times, as many times as possible, giving back as needed (greedy)
e
matches the character e with index 10110 (6516 or 1458) literally (case insensitive)
s
matches the character s with index 11510 (7316 or 1638) literally (case insensitive)
i
matches the character i with index 10510 (6916 or 1518) literally (case insensitive)
o
matches the character o with index 11110 (6F16 or 1578) literally (case insensitive)
n
matches the character n with index 11010 (6E16 or 1568) literally (case insensitive)
a
matches the character a with index 9710 (6116 or 1418) literally (case insensitive)
l
matches the character l with index 10810 (6C16 or 1548) literally (case insensitive)
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)
i modifier: insensitive. Case insensitive match (ignores case of [a-zA-Z])
Your regular expression does not match the subject string.

Regular Expression
No Match

r"
"
gmi

Test String