Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2018-01-22 03:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (231 votes). Check out past polls.

    Notices?