From 5a32926376110896f3f22c1bcb99c9c9d7d36fea Mon Sep 17 00:00:00 2001 From: mitty Date: Thu, 3 Jan 2013 15:50:31 +0000 Subject: [PATCH] * output matched pattern with "/PATTERN/" git-svn-id: https://lab.mitty.jp/svn/lab/trunk@185 7d2118f6-f56c-43e7-95a2-4bb3031d96e7 --- misc/regexfilter.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/misc/regexfilter.pl b/misc/regexfilter.pl index 801cbb0..fc45635 100755 --- a/misc/regexfilter.pl +++ b/misc/regexfilter.pl @@ -16,7 +16,7 @@ if (! -r $regexfile) { exit 1; } -my $re = Regexp::Assemble->new(file => "$regexfile"); +my $re = Regexp::Assemble->new(file => "$regexfile", track => 1); my $target = shift @ARGV; @@ -38,5 +38,9 @@ while ($line = <$input>) { else { print "NG: "; } - print $line, "\n"; + print $line; + if ($re->source) { + print " /", $re->source, "/"; + } + print "\n"; } -- 1.7.9.5