Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<regex.h>
- void main(int argc, char *argv[]) {
- regex_t regex;
- int res = regcomp (®ex, "[]0-9$*+?^]{1,63}", REG_EXTENDED);
- if(res)
- printf("error\n");
- else
- printf("success\n");
- res = regexec(®ex, argv[1], 0, NULL, 0);
- if (!res) {
- puts("Match\n");
- }
- else if (res == REG_NOMATCH) {
- puts("No match\n");
- }
- else {
- fprintf(stderr, "Regex match failed\n");
- }
- regfree (®ex);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement