I am trying to match a colon separated list of letters. To simplify the task, I'm going to leave the email expression out of the mix and match it with any number of characters without spaces between them.
The following will fit ...
somevalues ;somevalues; somevalues;
or
somevalues; somevalues ;somevalues
Ending; not required.
The following will not match.
somevalues ; some values somevalues;
or
some values; somevalues some values
I got it so far, but it will not work. Since I allow spaces between the colons, the expression does not know whether this word is in the word or between the colon.
([a-zA-Z]*\s*\;?\s*)*
The following is selected (which should not be e)
somevalue ; somevalues some values;
How to make an expression that allows spaces only if there is; left or right of it?
source
share