在C语言中使用正则表达式的几个API

来源:互联网 发布:中文.com域名注册 编辑:程序博客网 时间:2024/05/24 05:09

#include <regex.h>

1:int regcomp(regex_t *preg,const char *regex,int cflags);
2:int regexec(const regex_t *preg,const char *string,size_t nmatch,regmatch_t pmatch[],int

eflags);
typedef struct
{
    regoff_t rm_so;
    regoff_t rm_eo;
}regmatch_t;

3:void regfree(regex_t *preg);
4:size_t regerror(int errcode,const regex_t *preg,char* errbuf,size_t errbuf_size);

原创粉丝点击