正则表达式:检索与头部和尾部匹配的字符串

时间:2018-01-04 09:35:02

标签: python regex

我是RE的新手。实际上我有一个很长的字符串,如下所示:

[
   'https://sample.com/templates/sample/assets/img/menu.png' 
   'https://abcd.sample.com/templates/cp/assets/img/1_fs?123456' 
   'https://sample.com/templates/cp/js/plugins/sample/sample.css'
]

我想要检索的是中间的字符串:https://abcd.sample.com/templates/cp/assets/img/xyz1_fs?123456

你可以看到

匹配头部:https://abcd.sample.com和尾部_fs?123456

1 个答案:

答案 0 :(得分:0)

试试这个

this