fork download
  1. import re
  2.  
  3. regex = r"\|-{2,}[^-]+-{2,}([^-].*?)(?=\|)"
  4.  
  5. str1 = "|---------------------------------------------Title1(a)---------------------------------------------" \
  6. "" \
  7. "Content goes here, the quick brown fox jumps over the lazy dog" \
  8. "" \
  9. "|---------------------------------------------Title1(b)----------------------------------------------" \
  10. "" \
  11. "Content goes here, the quick brown fox jumps over the lazy dog" \
  12. "|"
  13.  
  14. str2 = re.findall(regex, str1);
  15. print(str2[0])
  16. print(str2[1])
Success #stdin #stdout 0.02s 9536KB
stdin
Standard input is empty
stdout
Content goes here, the quick brown fox jumps over the lazy dog
Content goes here, the quick brown fox jumps over the lazy dog