- //编译正则表达式,成功返回0,失败返回错误码
- int regcomp(regex_t *preg, const char *regex, int cflags);
//执行,pmatch与nmatch组合用来存储匹配的子串的位置.
-
int regexec(const regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags);
-
-
size_t regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size);
-
-
void regfree(regex_t *preg);