I am trying to create a regex to validate a string like this:
These are all valid
These are all invalid
Maximum length is 4 and only a single trailing * is permitted.
1 and 2 character strings are not permitted without a trailing *
3 character is OK – e.g. HIJ
4 character is OK as KLM* or KLMN
A-Z and the * only – plus the comma separator
No trailing comma.
I have to admit regex is beyond me.
This is as far as I have been able to get.
This examples limits it to a maximum of 10 occurrences.
Any help on this would be appreciated as I really struggle with regex,
I could code my way around it but that doesn’t seem a correct option.