libc下的regcomp解决思路

libc下的regcomp解决思路

libc下的regcomp
regcomp(&r, "href= "[0-9a-zA-Z#;@_:=/&%+?.-]+ " ",   REG_EXTENDED   |   REG_ICASE);

上面编译的正则表达式是用来提取html页面源代码里的href链接的,可以用regcomp编译通过;
但是其实我不想像href= "mailto: "和href= "javascript: "这类的href,所以又把正则表达式改了一下:

regcomp(&r, "href= "(?!mailto:|javascript:)[0-9a-zA-Z#;@_:=/&%+?.-]+ " ",   REG_EXTENDED   |   REG_ICASE);

这是这下用regcomp就编译不通过,好像是不支持(?!mailto:|javascript:)这样的表达式,那么请问我该如何提取开头不包含mailto和javascript的href?


先提取href後的,再自己分析好了,

libc下的regcomp解决思路

相关文章:

你感兴趣的文章:

标签云: