Red de conocimiento informático - Problemas con los teléfonos móviles - pitón regular

pitón regular

>>> importar re

>>>

>>> patt = re.compile(r"H3K(?P[^\ .]*)\..*")

>>>

>>> s = "H3K3490atmlth2.pted.grz.tedcrrhr1.cso"

>>> patt.match(s).groupdict().get("k")

'3490atmlth2'

>>>