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

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -