1
I have a log records in html, and would like to capture all the phone numbers, both fixed and mobile that are scattered throughout the file, I use the following regular expression currently: /(\(?\d{2}\)?) ?9?\d{4}-?\d{4}/
, only she’s missing some numbers that aren’t phones, which is wrong?
preg_match_all('/(\(?\d{2}\)?) ?9?\d{4}-?\d{4}/', $phone, $out);
echo '<pre/>';
print_r(array_shift($out));
number you passed: 99988877766
You can [Edit] the question and add examples of which numbers are being captured but which are not phones?
– Woss
show an excerpt from that file. Without it is unviable
– Daniel Omine
for example, dashless Cpfs are passing.
– Thiago
Put an example of your file, cite all the formats that exist in the phone number file. I did not understand your comment about CPF, and this wanting to capture Phone Number.
– David