clojure.string/split adds separator matches & failed matches (nil) when the separator is a regex with alternation

Description

I want to split a string on "; ", and optionally discard a final ";". So, I tried:

1 (clojure.string/split "ab; ab;" #"(; )|(;$)")

In Clojure, this does what I want:

1 ["ab" "ab"]

In ClojureScript, I get:

1 ["ab" "; " nil "ab" nil ";"]

I'm not sure to what extent this is a platform distinction and to what extent it's a bug. Returning nils and seperators from clojure.string/split's output seems like it's against string.split's contract?

Environment

None

Status

Assignee

Unassigned

Reporter

lvh

Labels

None

Approval

None

Patch

None

Affects versions

0.0-3308

Priority

Minor
Configure