#include <pcre.h>
int pcre_exec(const pcre *code,const pcre_extra *extra,const char *subject,intlength,intstartoffset,intoptions,int *ovector,intovecsize);
DESCRIPTIONThis function matches a compiled regular expression against a given subject string,using a matching algorithm that is similar to Perl's. It returns offsets to captured substrings. Its arguments are:
code Points to the compiled pattern extra Points to an associated pcre[16|32]_extra structure,or is NULL subject Points to the subject string length Length of the subject string,in bytes startoffset Offset in bytes in the subject at which to start matching options Option bits ovector Points to a vector of ints for result offsets ovecsize Number of elements in the vector (a multiple of 3)
上述的API介绍为Pcre官网的介绍,大致翻译为
该函数从给予的Subject中匹配一个编译后的正则表达式,使用和Perl相似的匹配算法。该函数返回匹配的子串的偏移量
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。