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

regex-sample.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <cupl.h>

Go to the source code of this file.

Functions

int main (int argc, char **argv)


Function Documentation

int main int  argc,
char **  argv
 

Definition at line 5 of file regex-sample.c.

References cupl_match_regex().

00005                                 {
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 }


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