假设我有这个示例字符串
<td><a href="/one-two-three/menus" title="test"</td>
<td><a href="/one-two-three/menus/13:00 title="test"</td>
<td><a href="/one-two-three/schedule/could be multiple delimiters/14:00 title="test"</td>
我想使用正则表达式仅在完整字符串/one-two-three
以hh:mm
. 例如我想得到:
/one-two-three/menus/13:00
/one-two-three/schedule/could be multiple delimiters/14:00
我试过正则表达式模式/one-two-three[\s\S]+?[0-9][0-9]:[0-9][0-9]
但这给了
Found 2 matches:
1./one-two-three/menus" title="test"</td> <td><a href="/one-two-three/menus/13:00
2./one-two-three/schedule/could be multiple delimiters/14:00
我可以明白为什么我会得到结果,但我的问题是我可以使用什么模式来排除部分,而在和hh:mm
之间可以有任意数量的分隔符/one-two-three
hh:mm