Need some help with a regular expression
How can I write an expression that filters everything between the delimiters (tab, comma, semicolon)? All the preceeding/trailing spaces must go as well.
Example input
Abra Cadabra ; Harry Potters,Magic Wand[tab]Sucks!
Matches
[Abra Cadabra]
[Harry Potters]
[Magic Wand]
[Sucks!]
Not desired
[Abra Cadabra ]
I came up with this to select everything BUT the output wanted
\s*[,;\t\n]\s*
Is there any way to “reverse” it?
As far as simple match/search goes, this one seems working:
BTW, I agree with kevin’s comment up there, I’d use something like
string.split(/\s*[,;\t]+\s*/)