summaryrefslogtreecommitdiffstats
path: root/regcheck.pl
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2014-10-08 16:51:47 +0200
committerFlorian Pritz <bluewind@xinu.at>2014-10-08 16:51:47 +0200
commit00173f3c9ad32118bfc3534a3b4e546b98d88cd9 (patch)
treec0008314698104ff5be68cc544d727bd362b8ddf /regcheck.pl
parent35bb36340a2955b69188422290223169b46e44b0 (diff)
downloadbin-00173f3c9ad32118bfc3534a3b4e546b98d88cd9.tar.gz
bin-00173f3c9ad32118bfc3534a3b4e546b98d88cd9.tar.xz
regcheck.pl: improve group match output
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'regcheck.pl')
-rwxr-xr-xregcheck.pl7
1 files changed, 4 insertions, 3 deletions
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";
}