开发者

Regular Expression to exclude a string?

I have a regular expression that runs through html tags and grabs values. I currently have this to grab all values within the tag.

<title\b[^>]*>(.*\s?)</title>

It works perfectly. So if I have a bunch of pages that have titles:

<tit开发者_如何学运维le>Index</title>

<title>Artwork</title>

<title>Theory</title>

The values returned are: Index, Artwork, Theory

How can I make this regular expression ignore all tags with the value Theory inside them?

Thanks in Advance


A basic look around would probably handle that.

<title\b[^>]*>(((?!Juju - Search Results).)*)(.*\s?)<\/title>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜