1b99bc125d897c0712377c4fb4d23ff9f6cbca9f
angie
  Fri Feb 25 11:43:27 2011 -0800
New src/inc/regexHelper.h module replaces the regex conveniencefunctions that were previously down in hg/lib/hgFindSpecCustom.c.
The primary motivation for this is so I can use regex functions in
the new src/lib/vcf.c for Feature #2821 (VCF parser), but I hope
this will make it easier in general to use regexes in any new code.

diff --git src/hg/inc/hgFindSpec.h src/hg/inc/hgFindSpec.h
index 8cc09e7..1088fde 100644
--- src/hg/inc/hgFindSpec.h
+++ src/hg/inc/hgFindSpec.h
@@ -1,26 +1,24 @@
 /* hgFindSpec.h was originally generated by the autoSql program, which also 
  * generated hgFindSpec.c and hgFindSpec.sql.  This header links the database and
  * the RAM representation of objects. */
 
 #ifndef HGFINDSPEC_H
 #define HGFINDSPEC_H
 
 #define HGFINDSPEC_NUM_COLS 12
 
-#include <regex.h>
-
 struct hgFindSpec
 /* This defines a search to be performed by hgFind. */
     {
     struct hgFindSpec *next;  /* Next in singly linked list. */
     char *searchName;	/* Unique name for this search.  Defaults to searchTable if not specified in .ra. */
     char *searchTable;	/* (Non-unique!) Table to be searched.  (Like trackDb.tableName: if split, omit chr*_ prefix.) */
     char *searchMethod;	/* Type of search (exact, prefix, fuzzy). */
     char *searchType;	/* Type of search (bed, genePred, knownGene etc). */
     unsigned char shortCircuit;	/* If nonzero, and there is a result from this search, jump to the result instead of performing other searches. */
     char *termRegex;	/* Regular expression (see man 7 regex) to eval on search term: if it matches, perform search query. */
     char *query;	/* sprintf format string for SQL query on a given table and value. */
     char *xrefTable;	/* If search is xref, perform xrefQuery on search term, then query with that result. */
     char *xrefQuery;	/* sprintf format string for SQL query on a given (xref) table and value. */
     float searchPriority;	/* 0-1000 - relative order/importance of this search.  0 is top. */
     char *searchDescription;	/* Description of table/search (default: trackDb.{longLabel,tableName}) */
@@ -61,39 +59,30 @@
 
 void hgFindSpecFreeList(struct hgFindSpec **pList);
 /* Free a list of dynamically allocated hgFindSpec's */
 
 void hgFindSpecOutput(struct hgFindSpec *el, FILE *f, char sep, char lastSep);
 /* Print out hgFindSpec.  Separate fields with sep. Follow last field with lastSep. */
 
 #define hgFindSpecTabOut(el,f) hgFindSpecOutput(el,f,'\t','\n');
 /* Print out hgFindSpec as a line in a tab-separated file. */
 
 #define hgFindSpecCommaOut(el,f) hgFindSpecOutput(el,f,',',',');
 /* Print out hgFindSpec as a comma separated list including final comma. */
 
 /* -------------------------------- End autoSql Generated Code -------------------------------- */
 
-boolean matchRegex(char *name, char *exp);
-/* Return TRUE if name matches the regular expression pattern
- * (case insensitive). */
-
-boolean matchRegexSubstr(char *name, char *exp, regmatch_t substrArr[],
-			 size_t substrArrSize);
-/* Return TRUE if name matches exp (case insensitive); regexec fills in 
- * substrArr with substring offsets. */
-
 int hgFindSpecCmp(const void *va, const void *vb);
 /* Compare to sort based on searchPriority. */
 
 struct hgFindSpec *hgFindSpecFromRa(char *db, char *raFile);
 /* Load track info from ra file into list. */
 
 char *hgFindSpecSetting(struct hgFindSpec *hfs, char *name);
 /* Return setting string or NULL if none exists. */
 
 char *hgFindSpecRequiredSetting(struct hgFindSpec *hfs, char *name);
 /* Return setting string or squawk and die. */
 
 char *hgFindSpecSettingOrDefault(struct hgFindSpec *hfs, char *name,
 				 char *defaultVal);
 /* Return setting string, or defaultVal if none exists */