I'm looking to find all fee codes in a page. The codes are 5 digits, with an optional single letter at the beginning. I have this currently, which is working great.
preg_match_all("/\b([a-zA-Z])?\d{5}\b/", $content, $matches);
My problem is I need to exclude any that occur within the 'title' attribute of a link.
<a href="#" title="Sample Fee – also see B11023">G14015</a>
I want to match on the G14015, but not B11023.
Any suggestions? Much appreciated.