两个模式之间的Java regex匹配

问题描述 投票:0回答:2

我的网址像

https://example.com/helloworld/.@==imhere 

https://example.com/helloworld/.@==imnothere?param1=value1

我想从这些URL中提取值imhereimnothere。>>

Pattern.compile("(?<=helloworld\\/@\\.id==).*(?=\\?)"); 

这个问题没有找到吗? (第一种情况)与模式不匹配。

有人可以帮我解决这个问题吗?

我有一个网址,例如https://example.com/helloworld/.@==imhere或https://example.com/helloworld/.@==imnothere?param1=value1我想在此处提取值或来自这些网址的链接。模式......

java regex
2个回答
1
投票

此表达式应该这样做:


0
投票

要在特定短语之后匹配下一个空格,问号或字符串结尾,Java正则表达式是这样的:

© www.soinside.com 2019 - 2024. All rights reserved.