in reply to substition in multiple lines
Seems to be working to me! -EricInput File -------------------------- this is a test [[ this is a test ]] this is also a test [[ this is also a test ]] Output -------------------------- this is a test this is also a test Code -------------------------- #!/usr/bin/perl -w use strict; open(FILE, "<test.txt") || die "Error: $!"; while(<FILE>) { $_ =~ s/\[\[[^\]]*\]s*\]/ /msg; print; } close(FILE);
|
|---|