La expresión regular de Python intercepta todo el contenido después de una cadena específica

Más clásico:

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

 

Supongo que te gusta

Origin blog.csdn.net/weixin_42859280/article/details/111936186
Recomendado
Clasificación