Match against a POSIX extended regular expression.
- Parameters
-
[in] | exp | the regular expression |
[in] | icase | true to ignore case sensitivity |
- Returns
- true if there is a match, false otherwise
- Exceptions
-
Definition at line 490 of file string.cpp.
References cstr(), likely, m_data, and unlikely.
Referenced by csdbg::parser::highlight(), csdbg::dictionary::lookup(), csdbg::tracer::on_dso_load(), and split().
492 i32 flags = REG_EXTENDED | REG_NOSUB;
498 i32 retval = regcomp(®exp, exp.cstr(), flags);
499 if (
likely(retval == 0) ) {
500 retval = regexec(®exp,
m_data, 0, NULL, 0);
506 i32 len = regerror(retval, ®exp, NULL, 0);
508 regerror(retval, ®exp, errbuf, len);
512 "failed to compile regexp '%s' (regex errno %d - %s)",
char i8
8-bit signed integer
#define likely(expr)
Offer a hint (positive) to the pipeline branch predictor.
int i32
32-bit signed integer
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.