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

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -