in reply to How do I match this without lookbehind?
However, you really don't need lookbehind or split to solve this problem: @matches = $string =~ /~?./g;