I’m trying to write a regex to validate a specific format. Here is it:
Or said otherwise:
- 0 or 1
- ; sign only between elements. Not on the last element.
- All of previous repeated, or not.
The specificity is that the string can not end with a “;”.
For now I’ve this
^(?:[a-z]+=;?)+(?<!;)$ which is right but not completely. since
foo=1;bar=0foo=0;bar=1passes but even tough this part
Here are my current regex and some testing strings: https://regex101.com/r/lX0xT7/1
Thank you for your help,