t524.py 324 B

123456789101112131415161718192021
  1. import re
  2. pattern = r"\n"
  3. print re.findall(pattern, "\n")
  4. print re.findall(pattern, "\n\n")
  5. print re.findall(pattern, "x\nx")
  6. print re.findall(pattern, "x\nx\n")
  7. pattern = r"\t"
  8. print re.findall(pattern, "\t")
  9. print re.findall(pattern, "\t\t")
  10. print re.findall(pattern, "x\tx")
  11. print re.findall(pattern, "x\tx\t")