python 正则表达式 截取特定字符串之后的全部内容

比较经典的:

>>> import re
>>> re.findall('(?<=com/).*$', "www.example.com/thedubaimall")
['thedubaimall']
>>> re.findall('(?<=com).*$', "www.example.com/thedubaimall")
['/thedubaimall']

猜你喜欢

转载自blog.csdn.net/weixin_42859280/article/details/111936186