Conditional statement
(?(...)|)If the given pattern matches, matches the pattern before the vertical bar. Otherwise, matches the pattern after the vertical bar.
Examples
PCRE PYTHON
Share & Embed
Use this snippet to display this token on your own site.
<!-- Embed Regex Token: (?(...)|) --> <code class="regex-token">(?(...)|)</code> - Conditional statement <small><a href="https://testregex.com/cheatsheet/conditional-statement">See details</a></small>