Skip to content

Add support for RegExp separators to String#split #8

@ndreynolds

Description

@ndreynolds

Add support for RegExp separators to str_proto_split in String.c and new tests in test_string_global.js.

Currently, only a string can be given as the separator, but the spec also allows a RegExp, e.g.

"Hello 1 word. Sentence number 2.".split(/(\d)/)
// ["Hello ", "1", " word. Sentence number ", "2", "."]

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions