https://github.com/root-project/root
Raw File
Tip revision: b021ae86a45df12d6cad5f1793090c8c98ac49fd authored by Rene Brun on 30 June 2009, 07:26:56 UTC
Tagging production version v5-24-00
Tip revision: b021ae8
RegE.h
/* -*- C++ -*- */
/*************************************************************************
 * Copyright(c) 1995~2005  Masaharu Goto (cint@pcroot.cern.ch)
 *
 * For the licensing terms see the file COPYING
 *
 ************************************************************************/
/*****************************************************************************
* RegExp.h
*
*
*****************************************************************************/

#ifndef REGEXP_H
#define REGEXP_H

#define G__REGEXPSL

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <regex.h>


class RegExp {
 public:
  RegExp(char *pattern) { regcomp(&re,pattern,REG_EXTENDED|REG_NOSUB); }
  ~RegExp() { regfree(&re); }
  int match(char *string) {
    return(!regexec(&re,string,(size_t)0,(regmatch_t*)NULL,0));
  }
 private:
  regex_t re;
};

int matchregex(char *pattern,char *string);
int operator==(RegExp& ex,char *string) ;
int operator!=(RegExp& ex,char *string) ;
int operator==(char *string,RegExp& ex) ;
int operator!=(char *string,RegExp& ex) ;


#endif

back to top