/*
Programmazione II - Esempio di codice
Example code: POSIX regex demonstration (20000817 prelz@mi.infn.it)
*/
#include
#include
/*POSIX Regexps*/
#include
#define N_MONTHS 12
int
main (int argc, char *argv[])
{
regex_t regbuf;
char *req_month;
int retcod;
char *month_regexp[N_MONTHS] = {
"\\b(ja|ge|1\\b)",
"\\b(fe|2\\b)",
"\\b(mar|mae|3\\b)",
"\\b(ap|av|4\\b)",
"\\b(may|mai|mag|5\\b)",
"\\b(gi|jun|juin|6\\b)",
"\\b(l|jul|juil|7\\b)",
"\\b(ag|ao|au|8\\b)",
"\\b(se|9\\b)",
"\\b(o|10\\b)",
"\\b(n|11\\b)",
"\\b(d|12\\b)" };
int i;
if (argc<2)
{
fprintf(stderr,"Usage: %s \n",argv[0]);
exit(1);
}
req_month = argv[1];
for (i=0;i.\n",req_month);
exit(0);
}