0 votes
in ReactJS by
What is conditional matching in Regex?

1 Answer

0 votes
by
-Using conditional matching  match the text from one of two given patterns.

(?(capturinggroup) pattern1/pattern2)

((?<n2>\d{2}-)\b\d{2}\b | \b\d{4}\b)

12-222-9999
...