Main Page | Data Structures | Directories | File List | Data Fields | Globals

regex-sample.c

Go to the documentation of this file.
00001 #include <stdio.h>
00002 #include <stdlib.h>
00003 #include <cupl.h>
00004 
00005 int main(int argc, char **argv) {
00006     if (argc < 3) {
00007         fprintf(stderr, "Usage: %s string pattern\n", argv[0]);
00008         fprintf(stderr, "       %s \"Some girls are walking\" \"^[Ssome]\"\n", argv[0]);
00009         return 0;
00010     }
00011 
00012     if (cupl_match_regex(argv[1], argv[2]) == 1)
00013         printf("String \"%s\" matched the pattern \"%s\".\n", argv[1], argv[2]);
00014     else
00015         printf("String \"%s\" didn't match the pattern \"%s\".\n", argv[1], argv[2]);
00016 
00017     return 1;
00018 }
00019 
00020 

Generated on Sat Aug 26 12:34:54 2006 for CUPL (Common UNIX Programming Library) by  doxygen 1.3.9.1