Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- patron_busqueda = re.compile(r'\"(.*)\"')
- cadena_texto = 'Python es "génial".'
- print(patron_busqueda.findall(cadena_texto))
- print('')
- cadena_texto = 'Python es "génial". Apto para "machine learning".'
- # Uso operador ?:
- patron_busqueda = re.compile(r'\"(.*?)\"')
- print(patron_busqueda.findall(cadena_texto))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement