Is there any way I can extract one example text that matches in a regex pattern?
For example:
Suppose that we have this regular expression pattern in JavaScript /^No I do(n't| not)\.?$/
There are multiple sentences which are valid in that: "No I don't", "No I do not", "No I don't.", "No I do not."
Is there a code or method or function that suggests at least one of these? (Driven just from the regex pattern)
/^No I do(n't| not)\.?$/ = = = > ["No I don't", "No I do not", "No I don't.", "No I do not."] or just "No I don't"