I'm only doing this because it is horrible practice to use a dot. The giveaway that you're doing something wrong in Regular Expressions is when you use the Single-Line option. That's a huge waste of resources and bound to break at some point.
This is 99.9% positively what you need to use:
$street_address_regex = '~14px;">([^<]*)~i';
Or, if you are (for some reason) expecting a < as a legitimate character, either meaning Less-than or formatting tags like bold or italics, then you can do this:
$street_address_regex = '~14px;">([^<]*<)*?\/span~i';
And if it bothers you enough that you don't want to have to format out the last <
character you'll get in your string, you can do this:
$street_address_regex = '~14px;">((?:[^<]*(?(?!<\/span)<))*)~i';
.
Test it With This Tester
.
But honestly, you shouldn't even be using Regex. Find the stripos of <span style="font-size:14px;">
and add its length (to get the Address Starting Point)... Then find the stripos of </span>
and input the offset point of the previously found Index (to get the Address Ending Point). Subtract them to get the length. Then pull the substr using the OriginalString, StartIndex, And Length.
Sounds like a lot, but make that a small function that you use instead of Regex, and just input the OriginalString, StartString, and EndString... then return the contents between StartString and EndString using the method I just said. Make the function re-usable.
With that function, that portion of your code will literally run 10 times faster, at least. Regex is powerful as hell for patterns, but you don't have a pattern, you have two static strings from which you want the contents between them. Regex is slow as hell for static string manipulation... Especially using the Dot with Single-Line ~Shiver~
$Input = '<span style="font-size:14px;">736 E 17th St</span><br />';
echo GetBetween($Input, '14px;">', '</span');
function GetBetween($OrigStr, $StartStr, $EndStr) {
$StartPos = stripos($OrigStr, $StartStr) + strlen($StartStr);
$EndPos = stripos($OrigStr, $EndStr, $StartPos);
return substr($OrigStr, $StartPos, $EndPos - $StartPos);
}