This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/59756] New: off-by-one error in regex
- From: "Nikolay.Bozhenov at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 10 Jan 2014 12:07:15 +0000
- Subject: [Bug libstdc++/59756] New: off-by-one error in regex
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59756
Bug ID: 59756
Summary: off-by-one error in regex
Product: gcc
Version: 4.8.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: Nikolay.Bozhenov at gmail dot com
example:
$ cat case.cpp
#include <iostream>
#include <string>
#include <regex>
int main() {
std::string re_s("abc(def)ghi");
std::regex re(re_s);
std::smatch mch;
std::regex_match(std::string("abcdefghi"), mch, re);
std::cout << mch[1].str() << std::endl;
}
compilation:
$ g++-4.8.2 case.cpp -std=c++11 -o case
actual result:
$ ./case
cdef
expected result:
$ ./case
def