diff options
author | 2018-09-11 18:18:58 +0000 | |
---|---|---|
committer | 2018-09-11 18:18:58 +0000 | |
commit | 820e1f31efc1d6ed04795ba2e79f3044e1907492 (patch) | |
tree | 815cebb3734784074b661935c33f00bd5eb4d862 /lib/libcxx/utils/google-benchmark/cmake/posix_regex.cpp | |
parent | Nuke unused LIST() ieee80211com_head. (diff) | |
download | wireguard-openbsd-820e1f31efc1d6ed04795ba2e79f3044e1907492.tar.xz wireguard-openbsd-820e1f31efc1d6ed04795ba2e79f3044e1907492.zip |
import of libc++ 6.0.0
Diffstat (limited to 'lib/libcxx/utils/google-benchmark/cmake/posix_regex.cpp')
-rw-r--r-- | lib/libcxx/utils/google-benchmark/cmake/posix_regex.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/libcxx/utils/google-benchmark/cmake/posix_regex.cpp b/lib/libcxx/utils/google-benchmark/cmake/posix_regex.cpp new file mode 100644 index 00000000000..466dc62560a --- /dev/null +++ b/lib/libcxx/utils/google-benchmark/cmake/posix_regex.cpp @@ -0,0 +1,14 @@ +#include <regex.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; + } + int ret = regexec(&re, str.c_str(), 0, nullptr, 0) ? -1 : 0; + regfree(&re); + return ret; +} + |