blob: a5fab14202e2a22da399da7b2f52c361ebb6e55b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#ifndef REG_EXP_H
#define REG_EXP_H
#include <string>
#include <stdint.h>
#include <regex.h>
#include <utility>
#include "bu/fstring.h"
class RegExp
{
public:
RegExp();
RegExp( const char *sSrc );
virtual ~RegExp();
void compile( const char *sSrc );
int getNumSubStrings();
bool execute( const char *sSrc );
std::pair<int,int> getSubStringRange( int nIndex );
std::string getSubString( int nIndex );
const char *getSource()
{
return sSrc.getStr();
}
private:
Bu::FString sSrc;
Bu::FString sTest;
regex_t re;
bool bCompiled;
int nSubStr;
regmatch_t *aSubStr;
};
#endif
|