my regex i wrote is (a|b)-(?(1)(1)|(2))
what it is supposed to do:
if a
then a-1
allowed
if b
then b-2
allowed
having group 1 = a or b and group 2 = 1 or 2
i have tried using ((?'a'a)|b)-(?(a)(1)|(2))
but it gave me different groups for numbers being group 3 or 4
how can i keep numbers group to 2
Aucun commentaire:
Enregistrer un commentaire