2005-11-09 16:43:05 -05:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
// FILE: regex.h
|
|
|
|
// AUTHOR: Johannes Winkelmann, jw@tks6.net
|
|
|
|
// COPYRIGHT: (c) 2005 by Johannes Winkelmann
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation; either version 2 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
2010-05-24 09:38:19 -04:00
|
|
|
#ifndef _PG_REGEX_H_
|
|
|
|
#define _PG_REGEX_H_
|
2005-11-09 16:43:05 -05:00
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <regex.h>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
|
|
class RegEx
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
RegEx(const std::string& pattern, bool caseSensitive=false);
|
|
|
|
~RegEx();
|
|
|
|
|
|
|
|
bool match(const std::string& input);
|
|
|
|
|
|
|
|
static bool match(const std::string& pattern,
|
|
|
|
const std::string& input,
|
|
|
|
bool caseSensitive=false);
|
|
|
|
|
|
|
|
private:
|
|
|
|
regex_t m_pattern;
|
|
|
|
bool m_validPattern;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* _REGEX_H_ */
|