开发者

How I create a regular expression to find lines of code that contain cflocation but do not contain addtoken?

I need a regular expression that will find lines with:

<cflocation url="index.cfm" addtoken="No">

but without the addtoken

<cflocation url="index.cfm">

The index.cfm can be any web address

I also added a comment below but this is for my text editor so I can search in files for 开发者_StackOverflow中文版all cflocation tags that are missing addtoken.

Thanks!


Try <cflocation\s+url="[^"]*"\s*>

You can test out regex's with data at regexpal.com.
You can use strfriend.com to explain regex's, an example output for the regex above is given below:

How I create a regular expression to find lines of code that contain cflocation but do not contain addtoken?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜