What regex will match every character except comma ',' or semi-colon ';'?
[^,;]+
You haven't specified the regex implementation you are using. Most of them have a Split
method that takes delimiters and split by them. You might want to use that one with a "normal" (without ^
) character class:
[,;]+
Use this:
([^,;]*[,;])*
use a negative character class:
[^,;]+
Use character classes. A character class beginning with caret will match anything not in the class.
[^,;]