java - 正则表达式(Java)

标签 java regex string

如何匹配下面的字符串?

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/

相关文章:

java - 如何在Linux中切换不同的java版本?

java - "org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions"即使上下文是线程

javascript - 在javascript中解析

string - Delphi XE3 : What are the new types, MarshaledString 和 MarshaledAString 有何用途?

java - 为什么字符串在许多编程语言中都是不可变的?

Java - 根据后缀从列表创建子列表

java - 从另一个kubernetes作业触发Kubernetes

python - 如何从字符串中提取IP地址

javascript - 从 HTML 字符串中解析所有 URL 的最佳方法是什么?

java - 如何打印我的 Java 对象而不得到 "SomeType@2f92e0f4"?