Regular Expressions 101

Save & Share

  • Save Regex
  • Update Regex


  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java 8


  • Match
  • Substitution
  • List
  • Unit Tests
(Esta condición)?(?(1) es verdadera| es falsa)
1st Capturing Group
(Esta condición)?
? matches the previous token between zero and one times, as many times as possible, giving back as needed (greedy)
Esta condición
matches the characters Esta condición literally (case sensitive)
(?(1) es verdadera| es falsa)
Conditionally matches one of two options depending on whether the 1st capturing group matched
If condition is met, match the following regex
es verdadera
es verdadera
matches the characters es verdadera literally (case sensitive)
Else match the following regex
es falsa
es falsa
matches the characters es falsa literally (case sensitive)
Global pattern flags
g modifier: global. All matches (don't return after first match)
Your regular expression does not match the subject string.Try launching the debugger to find out why.

Regular Expression
No Match


Test String