Created
April 12, 2018 12:34
-
-
Save Fhernd/1999b78cd1fab2d1756a7ece4664f46a to your computer and use it in GitHub Desktop.
Búscar y reemplazar texto en una cadena de caracteres. OrtizOL.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
python = "Python es un lenguaje de programación compilado" | |
print (python.replace('compilado', 'interpretado')) | |
evento = "Hoy es 12/04/2017. Fin recetas Python 13/01/2018" | |
print(re.sub(r'(\d+)/(\d+)/(\d+)', r'\3-\1-\2', evento)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment