Your "question" is lacking a lot of information, but from what I gather you want to read the address inside a <span>
tag with optional "
around it and followed by an optional <br>
followed by something your not interested in... Your RE seems overly complex, unless there are some syntax checking involved (not mentioned in the question either).
How about this:
<span\b.*?>"?(\d{1,5}.*?)"?(?:<br>|<\/span>)
It keeps the only obvious syntax check you have, namely the street number being present, 1 to 5 digits, but excepts for that grabs everything up to either a <br>
or </span>
, excluding surrounding quotes. Your test for North, East... doesn't really do any thing. And all the other "chopping up" of the RE goes beyond my understanding.
But, as the comments say, use a HTML-parser to extract the text you want to interpret.
Anyway, gave it a try ;)
Regards