This is so much fun I've gone and written a UDF just for Kevin :).
Pascal, thanks for the \b.*? because I don't use regexes that often and was
having a bit of an issue getting my .* to stop at > if you know what I mean.
I knew it was there, just couldn't remember it.
Here's the UDF (submitted to cflib already, too!):
<cffunction name="detableize">
<cfargument name="string" type="string" required="true" />
<cfset var outputString = arguments["string"]>
<cfset outputString = reReplaceNoCase(outputString , "</*table>", "",
"all")>
<cfset outputString = reReplaceNoCase(outputString , "</*t[rhd]\b.*?>", "",
"all")>
<cfset outputString = reReplaceNoCase(outputString , "(?m)^\s*", "", "all")>
<cfset outputString = reReplaceNoCase(outputString , "\n{2,}", "#chr(10)#",
"all")>
<cfreturn outputString />
</cffunction>
Hth...
Laterz!
J
On 5/18/05, Pascal Peters <[EMAIL PROTECTED]> wrote:
>
> If you just want to replace them, you can simplify. This will replace
> all opening and closing tr, td or th tags with an empty string (CFMX+
> only).
>
> <cfset noHtml = reReplaceNoCase(htmlString, "</*t[rhd]\b.*?>", "",
> "all")>
>
> Pascal
>
--
---------------
-------------------------------------
Buy SQLSurveyor!
http://www.web-relevant.com/sqlsurveyor
Never make your developers open Enterprise Manager again.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207007
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54