-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Copy link
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
Description
#include <string>
#include <regex>
#include <iostream>
using namespace std;
int main() {
string s = "ab";
regex re("$");
cout << "$" << endl;
cout << regex_search(s, re, regex_constants::match_default) << endl;
cout << regex_search(s, re, regex_constants::match_not_eol) << endl;
return 0;
}llvm-mingw 17.0.6:
D:\notepad2>clang++ -std=c++17 -Wall -Wextra test2.cpp
D:\notepad2>a.exe
$
0
0
GCC 13.2.0:
D:\notepad2>g++ -std=c++17 -Wall -Wextra test2.cpp
D:\notepad2>a.exe
$
1
0
MSVC 2022:
D:\notepad2>cl /nologo /EHsc /std:c++17 /W4 test2.cpp
test2.cpp
D:\notepad2>test2.exe
$
1
0
NOTE(ldionne): The first time an attempt was made to fix this, the following happened: #77256 (comment). Any fix for this issue should ensure not to break this use case:
#include <regex>
#include <string>
int main() {
std::string t = "a";
std::regex re {"^b*$"};
std::smatch matches;
return std::regex_search(t, matches, re);
}Metadata
Metadata
Assignees
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