0

I want to capture the final

tag in a string. Here's what I came up with:
 /(</p>)$/

Is this going to cause any problems in a typical html script that looks like this:

<p>Copyright 2010 &copy;</p>
<p>Sanscode</p>

It seems to work fine, but since i'm new to regex I was wondering if anyone had any caveats or things for me to note. I am using preg_replace().

Thanks

miku
  • 181,842
  • 47
  • 306
  • 310
Jason
  • 15,064
  • 15
  • 65
  • 105
  • 2
    [Please don't parse HTML with regular expressions.](http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454) – Antal Spector-Zabusky Dec 13 '10 at 00:30

1 Answers1

1

It would not match, if there are whitespace characters behind the last angel bracket.

miku
  • 181,842
  • 47
  • 306
  • 310