75#define REG_ICASE 0x0001
76#define REG_NEWLINE 0x0002
77#define REG_NOTBOL 0x0004
78#define REG_NOTEOL 0x0008
79#define REG_DOTALL 0x0010
80#define REG_NOSUB 0x0020
82#define REG_STARTEND 0x0080
83#define REG_NOTEMPTY 0x0100
84#define REG_UNGREEDY 0x0200
86#define REG_PEND 0x0800
87#define REG_NOSPEC 0x1000
158 virtual ~refcnted_regex_t()
169 return qregexec(®ex,
string, nmatch, pmatch, eflags);
173 if (
code != 0 && errmsg !=
nullptr )
183 bool case_insensitive,
188 refcnted_regex_t *p =
new refcnted_regex_t();
189 int rflags = REG_EXTENDED;
190 if ( case_insensitive )
207 return regex.re_nsub;
218 regex_cache_map_t::iterator it = cache.find(str);
219 if ( it == cache.end() )
225 it = cache.insert(regex_cache_map_t::value_type(str, rx)).first;
235 error(
"%s", errbuf.
c_str());
240 typedef std::map<qstring, regex_ptr_t> regex_cache_map_t;
241 regex_cache_map_t cache;
bool empty(void) const
Does the qstring have 0 non-null elements?
Definition pro.h:3168
iterator begin(void)
Get a pointer to the beginning of the qstring.
Definition pro.h:3177
const qchar * c_str(void) const
Convert the qstring to a char *.
Definition pro.h:3170
qrefcnt_obj_t(void)
Constructor.
Definition pro.h:2972
Smart pointer to objects derived from qrefcnt_obj_t.
Definition pro.h:2920
static refcnted_regex_t * create(const qstring &text, bool case_insensitive, qstring *errmsg)
Definition regex.h:181
DECLARE_UNCOPYABLE(refcnted_regex_t)
virtual void idaapi release(void) override
Call destructor.
Definition regex.h:163
int process_errors(int code, qstring *errmsg)
Definition regex.h:171
int exec(const char *string, size_t nmatch, regmatch_t pmatch[], int eflags)
Definition regex.h:167
size_t nsub(void)
Definition regex.h:204
int code
Definition fpro.h:88
Defines the interface between the kernel and the UI.
This is the first header included in the IDA project.
_qstring< char > qstring
regular string
Definition pro.h:3694
@ REG_INVARG
Definition regex.h:115
@ REG_ERANGE
Definition regex.h:111
@ REG_EMPTY
Definition regex.h:109
@ REG_ESIZE
Definition regex.h:112
@ REG_ASSERT
Definition regex.h:100
@ REG_NOMATCH
Definition regex.h:116
@ REG_BADPAT
Definition regex.h:102
@ REG_ECOLLATE
Definition regex.h:106
@ REG_EBRACK
Definition regex.h:105
@ REG_ECTYPE
Definition regex.h:107
@ REG_ESPACE
Definition regex.h:113
@ REG_EESCAPE
Definition regex.h:108
@ REG_EPAREN
Definition regex.h:110
@ REG_ESUBREG
Definition regex.h:114
@ REG_BADBR
Definition regex.h:101
@ REG_BADRPT
Definition regex.h:103
@ REG_EBRACE
Definition regex.h:104
qrefcnt_t< refcnted_regex_t > regex_ptr_t
Definition regex.h:211
idaman THREAD_SAFE int ida_export qregexec(const struct regex_t *preg, const char *str, size_t nmatch, struct regmatch_t pmatch[], int eflags)
idaman THREAD_SAFE size_t ida_export qregerror(int errcode, const struct regex_t *preg, char *errbuf, size_t errbuf_size)
idaman THREAD_SAFE int ida_export qregcomp(struct regex_t *preg, const char *pattern, int cflags)
idaman THREAD_SAFE void ida_export qregfree(struct regex_t *preg)
off_t regoff_t
Definition regex.h:54
regex_ptr_t & find_or_create(const qstring &str)
Definition regex.h:230
bool _find_or_create(regex_ptr_t **out, const qstring &str, qstring *errbuf=nullptr)
Definition regex.h:216
size_t re_nsub
Definition regex.h:60
int re_magic
Definition regex.h:59
const char * re_endp
Definition regex.h:61
void * re_g
Definition regex.h:62
regoff_t rm_eo
Definition regex.h:70
regoff_t rm_so
Definition regex.h:69