I have an expression that should either be wrapped with quotation marks from both sides or not at all, and I want to create a regex to capture this expression.
The point is, I don't want to duplicate the expression.
For example, if the expression is any single letter in english then the duplicated regex would be
^[a-z]|'[a-z]'$
Now both a and 'a' would be accepted.
Is there a way to define this regex without duplicating the expression?