Created
December 22, 2015 08:51
-
-
Save venj/6b6780195c22983b671b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <regex.h> | |
#include <unicode/uregex.h> | |
int main(int argc, char const *argv[]) | |
{ | |
regex_t regex; | |
if (regcomp(®ex, "\\w+", REG_ICASE | REG_EXTENDED)) { | |
printf("Error compile\n"); | |
exit(255); | |
} | |
char *str = "1212131www31212"; | |
int matches = 0; | |
int errorcode = regexec(®ex, str, matches, NULL, 0); | |
if (errorcode) { | |
printf("Error exec: %d\n", errorcode); | |
exit(255); | |
} | |
printf("Matches found.\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment