Skip to content

Capturing group in split doesn't contain the matches #330

Closed
@yangsibai

Description

@yangsibai

When I use capturing group in my pattern, I want the result of split can keep the matched strings. It seems the current implementation of split removed them.

For example: the patten is "(x)", the text is "1x2", the result should be ["1", "x", "2"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions