Regular Expressions 101

Save & Share

  • Save Regex
    ctrl+s
  • Update Regex
    ctrl+⇧+s

Flavor

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

Function

  • Match
  • Substitution
  • List
  • Unit Tests
/
(Esta condición)?(?(1) es verdadera| es falsa)
/
g
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)
Conditional
(?(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

/
/
g

Test String