I need to add a string in the middle of some sentences separated by \n.
For Example:
INPUT OUTPUT
V2+count -> V2+came+count
V6+num -> V6+came+num
V10+hi+town -> V10+came+hi+town
and
N2+hello -> N2+went+hello
N7+time -> N7+went+time
The code I wrote so far is
if ($new=~/\(came\)\|\(went\)/) {
my $prev_tag = $`;
if ($prev_tag5=~ /\(V\d+?\)?\+$/) {
$new=~ s/\(came\)\|//;
} else {
$new=~s/\(went\)\|//;
}
}
cameorwentin one specific case?+characters in your data (1) token delimiters — in fact you are working with a list of strings, or (2) whitespaces, you just wanted to emphasize them, or (3) literal plus+characters in the input/output? I am somewhat confused.