/* * ================================================== =================================== * * Filename: regex_test.c * * Description: * * Version: 1.0 * Created: 2011年04月06日 10时49分16秒 * Revision: none * Compiler: gcc * * Author: 齐保元 (qby), qibaoyuan@126.com * Company: ict,gucas * * ================================================== =================================== */ #include #include #include #include #include static char* substr(const char* str,unsigned start,unsigned end){ unsigned n=end-start; static char buf[256]; strncpy(buf,str+start,n); buf[n]=0; return buf; } int main(int argc,char** argv){ char *pattern; int x,z,no=0,cflags=0; char ebuf[128]={'\0'},lbuf[256]={'\0'}; regex_t reg; regmatch_t pm[10]; const size_t nmatch=10; pattern=argv[1]; z=regcomp(
linux下的正则表达式
最新推荐文章于 2023-07-01 17:41:18 发布