Sign in
pigweed
/
third_party
/
github
/
google
/
benchmark
/
5b41e128b359900264464c480dfd4f107625f3c9
/
.
/
cmake
/
posix_regex.cpp
blob: a31af80481af5799ce6ee597e64ab70edf4f2a83 [
file
] [
log
] [
blame
]
#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
;
}
return
regexec
(&
re
,
str
.
c_str
(),
0
,
nullptr
,
0
)
?
-
1
:
0
;
}