#include <stdio.h>
#include <Xfwf/RegExp.h>

/*
 * Author:
 * 	Brian Totty
 * 	Department of Computer Science
 * 	University Of Illinois at Urbana-Champaign
 *	1304 West Springfield Avenue
 * 	Urbana, IL 61801
 * 
 * 	totty@cs.uiuc.edu
 * 	
 */ 

int main(argc,argv)
int argc;
char **argv;
{
	char fsm[1024],regexp[1024];
	char *string,*re_comp();
	int status;

	if (argc != 3)
	{
		fprintf(stderr,"%s regexp string\n",argv[0]);
		exit(1);
	}
	RegExpPatternToRegExp(argv[1],regexp);
	string = argv[2];
	RegExpCompile(regexp,fsm,1024);
	status = RegExpMatch(string,fsm);
	printf("Matching '%s' with pattern '%s' (regexp '%s') returns %d\n",
	       string,argv[1],regexp,status);
	return(1);
}
