#!/usr/bin/perl -w use strict; #setup bus pins my @pinList=(); for my $i (0..15) { push @pinList,"pce_rx_n$i"; push @pinList,"pce_rx_p$i"; push @pinList,"pce_tx_n$i"; push @pinList,"pce_tx_p$i"; push @pinList,"cwx_tx_n${i}_blah"; push @pinList,"cwx_rx_p${i}bleh"; } # #Here lies the match string I am trying to build #I loosened it up more to match the tx or rx pins with any # pce or cwx prefix #my $match_str="[tr]x_n1[\\D\$]"; # #here is the Fix from Anaomalous Monk using the zero width #negative look-ahead assertion # my $match_str="[tr]x_n1(?!\\d)"; print "match_str=$match_str\n"; #now highlight any matches foreach my $pn (@pinList){ print "$pn"; if ($pn=~/$match_str/i) { print "***"; } print"\n"; }