I understand and will adapt my tactic to put a comma behind every word
then I search for double ,, and replace them with 1 ,
and then apply the regular expression.
Still in the second example it stopped rather early.
I must say thank you a lot for the effort.
Is there a site for online testing this regular expression stuff or program.
So I can learn this a bit.
I found a lot in Google but there are different kinds of regular expression for java and other ..
I have the impression that we are talking about different things.
I gave you regexp examples for a one-line tag-field content.
But you work with multi-line content in the tag-field MOOD?
If there exist multi-line content and other exceptions, then you should have to choose a different strategy.
Isolate different cases, treat each case for itself with it's own fitting pattern.
If possible, reduce the complexity, reduce the number of cases, ...
change the appearance of a different case into the appearance of an already existing case, in order to get one pattern for all cases.
Divide the whole problem into several single steps (actions), which can be treated by easy reg-expessions or by standard functions.
For example ...
... clean up all different spellings of "," or ", " or " ," or "," or whatever into one format.
... maybe convert multi-line into single-line, do the actions, convert into multi-line.