Shawn wrote: > > I think this is what you are asking for... > > $string=s/(\w+)_(NN|IN|AT)/$1/g; > $string='<SN>'.$string.'</SN>'; > > Shawn
I believe, there's a typo :-) $string =~ s/(\w+)_(NN|IN|AT)/$1/g; ^ If speed is important, it's good to avoid capturing. so $string =~ s/(\w+)_(?:NN|IN|AT)/$1/g; is quicker. Who want to have more speed, should use a positive look ahead: $string =~ s/(\w+)_(?=[NIA])(?:NN|IN|AT)/$1/g; Greetings, Andrea -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]