System.out.println("/cb/asdfad".matches("/(?!ab/|bc/).*"));//排除指定模式的url
参考:http://www.javaworld.com.tw/jute/post/view?bid=20&id=130126&sty=1&tpg=1&age=0
本文介绍了一个Java正则表达式的使用案例,演示如何通过正则表达式排除特定模式的URL。具体展示了如何利用matches方法结合否定前瞻断言来实现这一目标。
System.out.println("/cb/asdfad".matches("/(?!ab/|bc/).*"));//排除指定模式的url
参考:http://www.javaworld.com.tw/jute/post/view?bid=20&id=130126&sty=1&tpg=1&age=0

被折叠的 条评论
为什么被折叠?