Revision 40758af18b420fd6926aa8e867d4d7cb0dedece9 authored by Lorenzo Moneta on 27 June 2006, 15:10:25 UTC, committed by Lorenzo Moneta on 27 June 2006, 15:10:25 UTC

git-svn-id: http://root.cern.ch/svn/root/trunk@15577 27541ba8-7e3a-0410-8455-c3a389f83636
1 parent 82c2d97
Raw File
RegE.C
/*****************************************************************************
* RegExp.C
*
*
*****************************************************************************/
#include "RegE.h"

/**************************************************************************
* matchtregex()
**************************************************************************/
int matchregex(char *pattern,char *string)
{
  int i;
  regex_t re;
  i=regcomp(&re,pattern,REG_EXTENDED|REG_NOSUB);
  if(i!=0) return(0); 
  i=regexec(&re,string,(size_t)0,(regmatch_t*)NULL,0);
  regfree(&re);
  if(i!=0) return(0); 
  return(1); /* match */
}


int operator==(RegExp& ex,char *string) 
{
  return(ex.match(string));
}

int operator!=(RegExp& ex,char *string) 
{
  return(!ex.match(string));
}

int operator==(char *string,RegExp& ex) 
{
  return(ex.match(string));
}

int operator!=(char *string,RegExp& ex) 
{
  return(!ex.match(string));
}

back to top