My issue is sometimes the text field already contains a URL that contains a 4 digit number. I need to be able to ignore 4 digit numbers if they are within a URL, but still have the above code work for 4 digit numbers that are plain text. Help! Thanks.unless ($type eq "project" || $type eq "npalert" || $text =~ /RESID/) +{ my $digits_4 = qr{ \b \d{4} \b }xms; $text =~ s{ ($digits_4) } {<a href="resident-info.pl?do_what=view&unit=$1"><b>$1</b></ +a>}xmsg; my $digits_3 = qr{ \b \d{3} \b }xms; $text =~ s{ ($digits_3) } {<a href="resident-info.pl?do_what=view&unit=$1"><b>$1</b></ +a>}xmsg; }# end unless ($type eq "project") {
In reply to Replacing 3 and 4 digit numbers. by htmanning
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |