如何匹配下面的字符串?
http://localhost:8080/MenuTest/index.action
如果正则表达式在上述模式中包含“MenuTest”,则应返回 true。
干杯
最佳答案
也许您不需要正则表达式?
String url = "http://localhost:8080/MenuTest/index.action";
boolean hasWhatImLookingFor = url.contains("MenuTest");
关于java - 正则表达式(Java),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/684841/