regexp-examples icon indicating copy to clipboard operation
regexp-examples copied to clipboard

Support for conditional capture groups

Open tom-lord opened this issue 7 years ago • 0 comments

Conditional capture groups, e.g. /(group1)? (?(1)yes|no)/.examples are not yet supported.

This example should return: ["group1 yes", " no"].

This has been a feature of the ruby language since v2.0.0, although it is a little-known/rarely used language feature.

Note that unfortunately, a common use case is to use conditional capture groups in conjunction with look-arounds - which this library cannot support.

tom-lord avatar Feb 05 '18 10:02 tom-lord