When splitting with a pattern that is repeated, empty strings are left in the resulting list:
iex(1)> String.split("foo!bar!!!", %r/!/)
["foo", "bar", "", "", ""]
I would expect the result to simply be:
String.split/1 seems to remove repeated whitespace, which makes it seem inconsistent:
iex(1)> String.split("foo bar ")
["foo", "bar"]
This does start diverging from the semantics of :binary.split. Although we should probably at least support the :trim option, but that would still leave empty strings if the pattern is repeated at the beginning of the string.