“python regex obtenha palavra depois de string” Respostas de código

python regex Get String antes do personagem

You don't need regex for this

>>> s = "Username: How are you today?"
You can use the split method to split the string on the ':' character

>>> s.split(':')
['Username', ' How are you today?']
Tinky Winky

python regex obtenha palavra depois de string

regexp = re.compile("name(.*)$")
print regexp.search(s).group(1)
# prints " is ryan, and i am new to python and would like to learn more"
Hanna Solo

Respostas semelhantes a “python regex obtenha palavra depois de string”

Perguntas semelhantes a “python regex obtenha palavra depois de string”

Mais respostas relacionadas para “python regex obtenha palavra depois de string” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código