All pastes #266604 Raw Edit

Untitled

public text v1 · immutable
·published 2006-12-04 07:35 UTC
rendered paste body
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <locale.h>
#include <errno.h>


#include <pcre.h>

int main(int argc,char *argv[])
{
     pcre *re;
     char cgets[250];
     const char *error;
     int erroffset;
     re = pcre_compile("(0-9)#",0,&error,&erroffset,NULL);
     if( re )
     {
     while(1){
     printf("Enter the details you wish to match:");
     fgets(cgets,250,stdin);
     if( pcre_exec(re,NULL,cgets,strlen(cgets),0,0,NULL,0) == 0 )
            printf("Matches");
     else
            printf("No Match");
     }
     } else  {
            printf("Error in Regex Compilation");
     }
}