use strict; use warnings; my $regex = '\{\[%tqu.*]}'; my $subst = ''; while(my $line = ) { $line =~ s/$regex/$subst/gi; print $line."\n"; } __DATA__ 1. Ka6 ({Of course not} 1. b6 $2 Kb7 $11) 1... Kb8 (1... f4 2. b6 $18) {[%tqu "What is White's next move?","","",g3,"",0,b6,"misses the win:",0]} 2. g3 $1 13. g6 c3