我需要一个或多个正则表达式来匹配某个网站的某些无效url,在某个模式之后OR前有大写字母。正则表达式匹配大写字母包围的字符串模式
这些都是结构规则相匹配的无效网址:
- 定义网站
- 零或多个大写字母,如果该模式之后零个大写字母
- 模式
- 零,或更多大写字母,如果模式之前为零大写字母
要用实例s:
http://website/uppeRcase/pattern/upperCase // match it, uppercase before and after pattern
http://otherweb/WhatevercAse/pattern/whatevercase // do not match, no website
http://website/lowercase/pattern/lowercase // do not match, no uppercase before or after pattern
http://website/lowercase/pattern/uppercasE // match it, uppercase after pattern
http://website/Uppercase/pattern/lowercase // match it, uppercase before pattern
http://website/WhatevercAse/asdasd/whatEveRcase // do not match it, no pattern
在此先感谢您的帮助!
马里奥
该网站是一个网站,如“myintranet.mycompany.com”,该模式是一个常见的文件夹名称,如“上传” – Mario 2010-10-20 20:34:14
URL的路径组件可以区分大小写。主机名不是。 – novalis 2010-10-20 20:44:13
@novalis,经过深思熟虑并编辑。 – Brad 2010-10-20 20:49:07