#!/usr/bin/python
#
import re

str = "A programme description [internal comment] with flags and then something that follows. (Ep1/7). [HD] [S] Followed by The News [AD,S] Then Reporting Scotland."

trimmer_re = re.compile('\[[^[]*?\](\s*| then[^][]*?| follow[^][]*?)$', flags=re.UNICODE|re.IGNORECASE)

sub_made = True
while sub_made:
	print "From:", str
	(str, sub_made) = re.subn(trimmer_re, '', str)
	print " to:", str

print str
