I have a line that looks like this:
NoSpace1 ~ NoSpace2 ~ Contains Space3 ~ NoSpace4 ~ 2011-03-29 ~ FollowedBySpace5 (2)
I want to be able to select each group separated by ~
(that’s a [space]~[space]
). However, I can’t seem to find the correct regex structure.
I start with
^([^ ]*) ~ ([^ ]*) ~
which selects the first two groups as expected but if I repeat the pattern a third time, it doesn’t work (because “Contains Space3” contains a space. I have randomly been trying different ways to group it but have had no luck.
Can someone with more REGEX experience help me out?
Thank you!