2
0
mirror of https://github.com/boostorg/parser.git synced 2026-01-31 08:22:15 +00:00
Files
parser/benchmark-v1.1.0/cmake/gnu_posix_regex.cpp
2017-04-20 21:01:31 -05:00

13 lines
267 B
C++

#include <gnuregex.h>
#include <string>
int main() {
std::string str = "test0159";
regex_t re;
int ec = regcomp(&re, "^[a-z]+[0-9]+$", REG_EXTENDED | REG_NOSUB);
if (ec != 0) {
return ec;
}
return regexec(&re, str.c_str(), 0, nullptr, 0) ? -1 : 0;
}