开发者

c# regex: get all uri's, but not from a specific domain

开发者 https://www.devze.com 2022-12-13 00:27 出处:网络
i have a c# regex, which gives me all uri\'s in a document. it\'s this: <a[^>]*\\shref=[\\\"\"\\\'][^>]*\"

i have a c# regex, which gives me all uri's in a document. it's this:

<a[^>]*\shref=[\""\'][^>]*"

this one works, but i want to exclude al uri's (matches) which have the word 'doub开发者_JS百科leclick.net' in it, because those uri's i want to leave untouched, and the others i want to add some code to.

i've tried this: ((?!doubleclick.net).) somewhere in between found here http://bloggingabout.net/blogs/arjen/archive/2008/12/03/regex-exclude-lines-containing-a-specific-word.aspx but it doesn't work for me....

Michel


Please don't use regexes to parse HTML!

Grab a copy of the HTML agility pack and your life will be much simpler, and your application much less brittle.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号