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 -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -