i'm trying write regex validate specific format. here it:
key=0(or)1;key=0(or)1;(repeated-or-not);key=0(or)1.
or said otherwise:
- \w
- sign
- 0 or 1
- ; sign between elements. not on last element.
- all of previous repeated, or not.
the specificity string can not end ";".
for i've ^(?:[a-z]+=[01];?)+(?<!;)$ right not completely. since foo=1;bar=0foo=0;bar=1passes tough part bar=0foo=0is incorrect.
here current regex , testing strings: https://regex101.com/r/lx0xt7/1
thank help, cheers,
Comments
Post a Comment