I'm trying to use (.+?)
to isolate the words "I. NEED. ISOLATION" in the source below:
<strong>Label:</strong></font></td>
<td valign="top" width="82%"> <font face="Arial" size="2">
I. NEED. ISOLATION </font> </td>
using (.+?)
, I could do this:
$regex = '/stuff before(.+?)stuff after/';
and for this html, that would be:
$regex = '/<strong>Label:</strong></font></td>
<td valign="top" width="82%"> <font face="Arial" size="2">
(.+?) </font> </td>/';
but it's choking up on it because of incorrect escaping. I'm not great in PHP. Can someone please advise which characters I should also escape based on html that looks like this?
<strong>Label:</strong></font></td>
<td valign="top" width="82%"> <font face="Arial" size="2">
I. NEED. ISOLATION </font> </td>
Note that I'm not trying to design a regex pattern. I already have the pattern nailed down with (.+?)
, just need to know how to correctly escape the html so that php doesn't choke up on it.