From 00173f3c9ad32118bfc3534a3b4e546b98d88cd9 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 8 Oct 2014 16:51:47 +0200 Subject: regcheck.pl: improve group match output Signed-off-by: Florian Pritz --- regcheck.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'regcheck.pl') diff --git a/regcheck.pl b/regcheck.pl index c5b5f89..a89b562 100755 --- a/regcheck.pl +++ b/regcheck.pl @@ -14,13 +14,14 @@ for my $string (@ARGV) { if (my @matches = $string =~ /$pattern/) { print "\e[0;32mmatches:\e[0m "; if ($#- != 0) { + print "\n"; + my $counter = 0; for my $match (@matches) { - print $match; + print $counter++.": \"".$match."\"\n"; } } else { - print "$&"; + print "$&\n"; } - print "\n"; } else { print "\e[0;31mno match\e[0m\n"; } -- cgit v1.2.3-24-g4f1b