use strict; my $string="Referring Hospital Triage Time <183> 2 h (N <26> 191)"; my $pre_str="Referring Hospital"; my $str1=$string; $str1=~s/$pre_str(.*?)/$1/; print "$str1\n";
Output: Triage Time <183> 2 h (N <26> 191)
One more thing The \Q tells Perl where to start escaping special characters, and the \E tells it where to stop, and in your $pre_str, i am not finding any special characters in your given example, so no need to use it.
In reply to Re: Help with substitution
by Nikhil Jain
in thread Help with substitution
by tej
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |