mame/3rdparty/benchmark/cmake/gnu_posix_regex.cpp
Miodrag Milanovic 042050ef67 Added Google Benchmark library (nw)
Included sample benchmark for eminline for native and noasm
Made GoogleTest compile only if tests are compiled
2016-01-29 11:47:40 +01:00

12 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;
}