Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F86485306
posix_regex.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Oct 6, 18:56
Size
297 B
Mime Type
text/x-c
Expires
Tue, Oct 8, 18:56 (2 d)
Engine
blob
Format
Raw Data
Handle
21431689
Attached To
R12667 gbench-stream
posix_regex.cpp
View Options
#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
;
}
Event Timeline
Log In to Comment