fork download
  1. import re
  2.  
  3. s1 = """
  4. Python is a high-level, interpreted, Good&
  5. general|purpose| programming| language.
  6. Its design philosophy emphasizes code Better
  7. readability with the use of significant Best
  8. indentation|
  9. """
  10. pattern = r'^[^|\n]*(?<!\S)(?:Good|Better|Best)(?!\S)[^\n|]*$'
  11.  
  12. print(re.findall(pattern, s1, re.M))
Success #stdin #stdout 0.03s 9304KB
stdin
Standard input is empty
stdout
['   Its design philosophy emphasizes code   Better', '   readability with the use of significant Best']