August 19th, 2013, 01:09 AM
Is it possible to detect if text contains email or phone number?
I highly doubt this would be possible but;
Is there anyways to detect the following numbers and emails in such strings?
$string = "This is some random text, Lispsun
0 4 2 4 0 333 2 2 2.
O for to for tree tree tree six for nine
I can also have some email address like
myemail @ gmail.com
August 19th, 2013, 02:44 AM
Considering how there's one definitive way to tell whether a particular part of a string is an email address or a phone number (presence of a @) then yes: regular expressions. Run one that can find email addresses and another that can find phone numbers against your text.