Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[libc++] <regex>: Optional empty repetitions should not match #133314

Copy link
Copy link
Open
@Alcaro

Description

@Alcaro
Issue body actions
> /(a?)+/.exec("aaa")
Array [ "aaa", "a" ]
> /((b)?(be)?)+bbee/.exec("bbebbee")
Array(4) [ "bbebbee", "bbe", "b", "be" ]

~Firefox

But in libc++, the equivalent operations return [ "aaa", "" ] and [ "bbebbee", "", undefined, undefined ].

Full example: https://godbolt.org/z/zYYenvEdb (blatantly modified from microsoft/STL#5365)

Bug also exists in libstdc++ and ms-stl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120212
microsoft/STL#5490

Metadata

Metadata

Assignees

No one assigned

    Labels

    libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.regexIssues related to regexIssues related to regex

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.