ArifS has asked for the wisdom of the Perl Monks concerning the following question:
I also would like to filter any line that matches any of the following & replace with a (dash) - :use strict; use warnings; my $text; while (my $text = <DATA>) { # match a word that contain 'ou' or # if ($text =~ m/(ou)|(#)$/) { print $text; } } __DATA__ hello.world# world\tour Game.started OUTPUT hello.world# world\tour
eg:\/:*?"<>|
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regex renaming
by toolic (Bishop) on Nov 03, 2014 at 19:30 UTC | |
|
Re: regex renaming
by davido (Cardinal) on Nov 03, 2014 at 23:02 UTC | |
by perlron (Pilgrim) on Nov 04, 2014 at 04:07 UTC | |
by james28909 (Deacon) on Nov 04, 2014 at 10:36 UTC | |
|
Re: regex renaming
by perlron (Pilgrim) on Nov 03, 2014 at 19:31 UTC |