Advertisement
Fhernd

multiples-patrones-busqueda.py

Apr 15th, 2018
2,246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. import re
  2.  
  3. patron_comentario = re.compile(r'/\*(.*?)\*/')
  4.  
  5. comentario_java = '/* Comentario en Java.*/'
  6.  
  7. print(patron_comentario.findall(comentario_java))
  8.  
  9. comentario_java = '''/*Comentario multilínea
  10. Java.*/'''
  11.  
  12. print(patron_comentario.findall(comentario_java))
  13.  
  14. patron_comentario = re.compile(r'/\*((?:.|\n)*?)\*/')
  15.  
  16. print(patron_comentario.findall(comentario_java))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement