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
/
(el|para|por|que|cual|como|de|sus|una?)\s
/
gm
matches the character with index 3210 (2016 or 408) literally (case sensitive)
1st Capturing Group
(el|para|por|que|cual|como|de|sus|una?)
1st Alternative
el
el
matches the characters el literally (case sensitive)
2nd Alternative
para
para
matches the characters para literally (case sensitive)
3rd Alternative
por
por
matches the characters por literally (case sensitive)
4th Alternative
que
que
matches the characters que literally (case sensitive)
5th Alternative
cual
cual
matches the characters cual literally (case sensitive)
6th Alternative
como
como
matches the characters como literally (case sensitive)
7th Alternative
de
de
matches the characters de literally (case sensitive)
8th Alternative
sus
sus
matches the characters sus literally (case sensitive)
9th Alternative
una?
un
matches the characters un literally (case sensitive)
a
matches the character a with index 9710 (6116 or 1418) literally (case sensitive)
\s matches any whitespace character (equivalent to [\r\n\t\f\v ])
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...