Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Recognizing numbers and creating links

by bitingduck (Chaplain)
on Apr 14, 2015 at 04:21 UTC ( #1123354=note: print w/replies, xml ) Need Help??

in reply to Recognizing numbers and creating links

There are certainly more clever ways to do it, but for small data sets (as in takes less than a few minutes to process) I'd just do multiple passes, where on the first one I'd find all the phone numbers and wrap them in some kind of tag (typically an xml-ish tag, but really anything you won't see in the regular data set, like a double underscore) so that I know to ignore them on the next pass. Then on the next pass I'd make the regex and/or logic such that it ignores things tagged as phone numbers. If I get motivated later this evening I'll post some code.

  • Comment on Re: Recognizing numbers and creating links

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1123354]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2018-07-23 02:35 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (459 votes). Check out past polls.