It works, but it also tags numbers within a phone number 555-555-5555. How can I make it work only if there is a space before the 4 digits? That would preclude it from being recognized in a string of numbers such as dates and phone numbers. Thanks.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;
In reply to Recognizing 3 and 4 digit number by htmanning
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |