skip to content
Alvin Lucillo

Conditional pattern regex

/ 1 min read

💻 Tech

To create conditional matches, use groups with logical OR or the pipe character |.

Regex: Buy (veg|fruit)

Buy meat
Pay bills
Buy veg    -- matches
Buy fruit  -- matches
Buy bread