regex - Remove a word from a line if the word contains a particular pattern in perl -
i have line "append serial=xyx end"; search line "serial" , if present in line remove until next space character current position. line like: "append end" after operations completed
thank you!
use code:
my $string = "append serial=xyx end"; $string =~ s/serial\=.*\s+//; warn $string;
output:
append end @ test.pl line 3.
Comments
Post a Comment