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:\/:*?"<>|
In reply to regex renaming by ArifS
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |