【发布时间】:2018-04-03 11:16:47
【问题描述】:
我想像这样匹配网址:
输入:
x = "https://play.google.com/store/apps/details?id=com.alibaba.aliexpresshd&hl=en"
get_id(x)
输出:
com.alibaba.aliexpresshd
在 python 中使用 re 的最佳方法是什么?
def get_id(toParse):
return re.search('id=(WHAT TO WRITE HERE?)', toParse).groups()[0]
我发现只有一个点的情况。
【问题讨论】: