How to remove a trailing blank space in a regex substitution?
Here the Data
__Data__
Test - results
dkdkdkdkdkdkdkdkdkkkdkd
slsldldldldldldldldldll
Information
ddkdkdkeieieieieieieiei
eieieieieieieieieieieiei
Test - summary
dkdkdkdkdkdkdkdkkdkdkdk
dkdkdkdkdkdkdkdkdkdkdkk
What I would like to remove these lines shown above:
Information
ddkdkdkeieieieieieieiei
eieieieieieieieieieieiei
My attempt using regex expression
$/ = "__Data__";
$_ =~ s/^(Test.*[^\n]+)\n(Information.*[^\n]+)\n(Test.*Summary[^\n]+)/$1$3/ms;
print $_
The input of the data is the same as the output. In other words, nothing changes.