htmanning has asked for the wisdom of the Perl Monks concerning the following question:
How can I work around the same 3 or 4 digit number appearing multiple times in the $text field? Thanks,my @numbers4 = $text =~ /\b \d{4} \b/gx; foreach $unit4 (@numbers4) { $text =~ s/$unit4/\<a href=\"unit=$unit4\"\>\<b\>$unit4\<\/b\>\<\/a\>/ +i; } # look for 3 digit numbers and make link to Resident Info card. my @numbers3 = $text =~ /\b \d{3} \b/gx; foreach $unit3 (@numbers3) { $text =~ s/$unit3/\<a href=\"?unit=$unit3\"\><b\>$unit3<\/b\>\<\/a\>/i +; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Recognizing numbers and creating links
by AnomalousMonk (Archbishop) on Apr 13, 2015 at 21:15 UTC | |
by htmanning (Friar) on Apr 13, 2015 at 23:12 UTC | |
by AnomalousMonk (Archbishop) on Apr 14, 2015 at 00:41 UTC | |
Re: Recognizing numbers and creating links
by AnomalousMonk (Archbishop) on Apr 13, 2015 at 20:51 UTC | |
Re: Recognizing numbers and creating links
by Anonymous Monk on Apr 13, 2015 at 22:31 UTC | |
Re: Recognizing numbers and creating links
by FreeBeerReekingMonk (Deacon) on Apr 14, 2015 at 07:54 UTC | |
Re: Recognizing numbers and creating links
by bitingduck (Deacon) on Apr 14, 2015 at 04:21 UTC |