in reply to Don't understand behavior of this split

See split. You don't show us the code you're using, but split returns captured items in the regex as well. Instead of splitting, maybe matching what you want to keep works better for you?