fork(3) download
  1. import re
  2. text = """|start| this is first para to remove |end|.
  3. this is another text.
  4. |start| this is another para to remove |end|. Again some free text"""
  5. print( re.sub(r'(?s)\|start\|.*?\|end\|[^\w\s]*', '', text) )
Success #stdin #stdout 0.02s 9472KB
stdin
Standard input is empty
stdout
this is another text.
 Again some free text