I cannot figure out how to make this RegEx syntax work. https://regex101.com/r/Zcxjtn/1
I would like to check whether a string is valid or not. Rules:
- The string must consist of 3 capital letters [A-Z]
- If the string is longer than each 3 capital letter blocks must be seperated by a semicolon (;) only
- The string must not start and end with a seperator (;)
- optional: whitespaces are allowed between seperator and next 3-letter sub-string
examples of valid strings:
AAA;BBB
AAA; BBB
AAA
examples of invalid strings:
;AAA
AAA;BBB;
123;AAA