This content has been marked as final.
Show 8 replies
-
1. Re: replace
spill-wjzVEv Dec 9, 2008 2:15 PM (in response to Nick201)the replace function
#Replace("<h2>test page</h2>", "<h2>", "" ,"All")# -
2. Re: replace
Nick201 Dec 9, 2008 2:21 PM (in response to spill-wjzVEv)see how about </h2>. . dosn't go away -
3. Re: replace
Newsgroup_User Dec 9, 2008 2:34 PM (in response to spill-wjzVEv)Nick201 wrote:
> see how about </h2>. . dosn't go away
You could use a second replace statement for the closing tags.
OR
You could use the rereplace() function with some regular expression
syntax that allows for pattern matching.
#rereplace("<h2>test page</h2>", "<\\*h2>", "" ,"All")#
Untested regex but I think that would be the right one. -
4. Re: replace
spill-wjzVEv Dec 9, 2008 2:35 PM (in response to Nick201)well you could run it twice, or use a regular expression to remove them. This will strip all html out of the string.
REReplaceNoCase(<h2>test page</h2>,"<[^>]*>","","ALL"); -
5. replace
-==cfSearching==- Dec 9, 2008 2:37 PM (in response to Nick201)> I have string like that "<h2>test page</h2>" in the db.
For handling html, regular expressions are usually the best bet. Try one of the functions at cflib.org, such as:
http://www.cflib.org/index.cfm?event=page.udfbyid&udfid=1598
I have not tried that one, but there are several that do a good job with variable white space in tags (< / h2> ) and optional attributes. -
6. Re: replace
-==cfSearching==- Dec 9, 2008 2:39 PM (in response to Nick201)Oops. I did not see spill's response before replying ;-) -
7. Re: replace
spill-wjzVEv Dec 9, 2008 2:46 PM (in response to Nick201)he he im just too fast for you, but it was worth you posting that function is much more substantial than the standard REReplace as it allows you to specify a specific tag. -
8. Re: replace
-==cfSearching==- Dec 9, 2008 4:46 PM (in response to spill-wjzVEv)Haha. Yes, too slow at the keyboard today ;-)