head	1.1;
access;
symbols;
locks
	gtoal:1.1; strict;
comment	@ * @;


1.1
date	2021.11.03.19.28.06;	author gtoal;	state Exp;
branches;
next	;


desc
@Header for lex_regex.c
@


1.1
log
@Initial revision
@
text
@#ifndef __LEX_REGEX_H__
#define __LEX_REGEX_H__ 1
/*
  Some examples:
  if (lex_regex("[A-Z][A-Z]*", "... FRED ok?", "\\0", &matched)) fprintf(stderr, "Passed: %s\n", matched); else fprintf(stderr, "Failed\n");
  if (lex_regex("[A-Z][A-Z]*", "... fred ok?", "\\0", &matched)) fprintf(stderr, "Failed\n"); else fprintf(stderr, "Passed\n");
  if (lex_regex("[A-Z][A-Z]*", "... FRED ok?", "\\A", &matched)) fprintf(stderr, "Failed\n"); else fprintf(stderr, "Passed\n");
  if (lex_regex("^([^A-Z]*)([A-Z][A-Z]*)(.*)", "... FRED ok?", "\\1[[\\2]]\\3", &matched)) fprintf(stderr, "Passed: %s\n", matched); else fprintf(stderr, "Failed\n");
  if (lex_regex("[A-Z][A-Z]*", "... FRED ok?", "\\7", &matched)) fprintf(stderr, "Failed\n"); else fprintf(stderr, "Passed\n");
  if (lex_regex("[A-Z][A-Z]*", "... FRED ok?", "\\0", NULL)) fprintf(stderr, "Passed\n"); else fprintf(stderr, "Failed\n");
 */
int lex_regex(char *regexs, char *p, char *replace, char **matched);
#endif
@
