gpt4 book ai didi

java - 正则表达式(Java)

转载 作者:行者123 更新时间:2023-12-01 06:48:33 28 4
gpt4 key购买 nike

如何匹配下面的字符串?

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/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com