Code:
<%
...
thStr = "The difficulty of launching and recovering seaboats<br><br><BR>"
Set reZap = New RegExp
reZap.Pattern = "(\<br[^\>]*\>)+$"
reZap.IgnoreCase = True
thStr = reZap.Replace( thStr, "" )
...
%>
That will handle all variants of a <br> tag, including
<br style="something or other">
<br class="whatever">
<br >
<br/>
and more.
It says:
( )+ -- one or more times
$ -- at the end of the text
\<br -- look for a starting <br
[^\>]* -- followed by any number of non-> characters
\> -- and finally a > character
And then the replace zaps all of those, replacing them with a blank string.
If you'd like to provide for spaces and/or newlines mixed in amongst the <br>s, either before or after or between, just change to:
Code:
reZap.Pattern = "(\s*\<br[^\>]*\>)+\s*$"
Completely untested, off the top of my head. Still warranted against all bugs* for 30 picosends or 30 bits, whichever comes first.
*bugs must have 6 or 8 legs to be covered.