Open
Description
> /(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
Labels
libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.Issues related to regexIssues related to regex