You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Constructed without throwing: oops!
regex_match threw instead: oops!
The expression contained an invalid back reference.
I claim that the constructor should detect and throw on this pattern, rather than throwing at match time. The same issue happens with the "std::regex::grep" dialect, too.
The text was updated successfully, but these errors were encountered:
Extended Description
#include
#include <stdio.h>
int main() {
std::regex rx("(cat)\1", std::regex::basic);
puts("Constructed without throwing: oops!");
try {
std::regex_match("(cat)", rx);
} catch (std::exception& e) {
puts("regex_match threw instead: oops!");
puts(e.what());
}
}
The output is:
Constructed without throwing: oops!
regex_match threw instead: oops!
The expression contained an invalid back reference.
I claim that the constructor should detect and throw on this pattern, rather than throwing at match time. The same issue happens with the "std::regex::grep" dialect, too.
The text was updated successfully, but these errors were encountered: