Regular Expression to capture the last </p> tag and replace it with some text
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 ©</p>
<p>Sanscode开发者_JAVA技巧</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
It would not match, if there are whitespace characters behind the last angel bracket.
精彩评论