I am editing a perl module to parse data that has some variations:
Example 1
<div class="text">32779 Kudo Dr<br>Mission, BC V2V 6T5<br>(604) 826-9091</div>
Example 2
<div class="text">Surrey, BC<br>(604) 951-3777</div>
The second example does not have an address or the following <br>.
This regex works for the first example, but creates boo-boos with the second:
'regexp' => 'textb".*?=">(.*?),\n\t+(.*?)</a>.*?\n.*?=">.*?[COLOR=red yellow]<div class="text">(.*?)<br>(.*?), (\w\w)(.*?)<br>(.*?)</div>\n[/color]'
I have made several attempts at a nested expression to find, or NOT to find, the address<br>, but no luck yet.
Also, the missing address does need to be represented as a value to match the numbering system.
'data_names' => ['surname', 'name', 'address', 'city', 'state', 'zipcode', 'phone' ],
'order' => [ '1', '2', '3', '4', '5', '6', '7' ],
Thanks
Mike
Example 1
<div class="text">32779 Kudo Dr<br>Mission, BC V2V 6T5<br>(604) 826-9091</div>
Example 2
<div class="text">Surrey, BC<br>(604) 951-3777</div>
The second example does not have an address or the following <br>.
This regex works for the first example, but creates boo-boos with the second:
'regexp' => 'textb".*?=">(.*?),\n\t+(.*?)</a>.*?\n.*?=">.*?[COLOR=red yellow]<div class="text">(.*?)<br>(.*?), (\w\w)(.*?)<br>(.*?)</div>\n[/color]'
I have made several attempts at a nested expression to find, or NOT to find, the address<br>, but no luck yet.
Also, the missing address does need to be represented as a value to match the numbering system.
'data_names' => ['surname', 'name', 'address', 'city', 'state', 'zipcode', 'phone' ],
'order' => [ '1', '2', '3', '4', '5', '6', '7' ],
Thanks
Mike