我如何匹配以下字符串?
http://localhost:8080/MenuTest/index.action
Run Code Online (Sandbox Code Playgroud)
如果正则表达式在上面的模式中包含"MenuTest",则它应该返回true.
干杯
也许你不需要正则表达式?
String url = "http://localhost:8080/MenuTest/index.action";
boolean hasWhatImLookingFor = url.contains("MenuTest");
Run Code Online (Sandbox Code Playgroud)