I have a pattern that selects phone numbers in bock of html and its works perfect (I use it to make numbers show only when click on "Show"number" with a div a wrap the number in with "preg_replace".
$pattern = '!(\b\+?[0-9()\[\]./ -]{7,17}\b|\b\+?[0-9()\[\]./ -]{7,17}\s+(extension|x|#|-|code|ext)\s+[0-9]{1,6})!i';
The problem is its selects numbers inside IMG A tags.
For example: domain.com/images/09/2015 , the number "09/2015" will be selected.
Or a link domain.com/2015/09 "2015/09" will be selected by the pattern.
How could i set the pattern is not inside those tags?
This is a not question how to extract data from html. I know there are a few other ways. The script works and matches the numbers i need. my question is how could i extend the pattern in this script to not include matches between A IMG tags.