Re: strip ntext chars
Ben doesn't drink beer, so I get his. On Thu, Oct 18, 2012 at 12:38 PM, John M Bliss bliss.j...@gmail.com wrote: Oh, sweet! Thanks! (I owe Ben SO MANY BEERS. And, of course, Ray.) On Thu, Oct 18, 2012 at 12:34 PM, Robert Harrison rob...@austin-williams.com wrote: Reread your post. You may want to look at Ben Nadel's blog: http://www.bennadel.com/blog/1155-Cleaning-High-Ascii-Values-For-Web-Safeness-In-ColdFusion.htm ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:352957 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: strip ntext chars
Fair enough. On Fri, Oct 19, 2012 at 8:56 AM, Raymond Camden raymondcam...@gmail.comwrote: Ben doesn't drink beer, so I get his. On Thu, Oct 18, 2012 at 12:38 PM, John M Bliss bliss.j...@gmail.com wrote: Oh, sweet! Thanks! (I owe Ben SO MANY BEERS. And, of course, Ray.) On Thu, Oct 18, 2012 at 12:34 PM, Robert Harrison rob...@austin-williams.com wrote: Reread your post. You may want to look at Ben Nadel's blog: http://www.bennadel.com/blog/1155-Cleaning-High-Ascii-Values-For-Web-Safeness-In-ColdFusion.htm ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:352958 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
strip ntext chars
Hi. I have a database column that is (for now) of type text. (For now) I cannot change it to ntext. What's the best way to use CF to strip out (or replace) characters that require ntext prior to inserting the text. Here's my first attempt which did not seem to work: cfloop index=charcounter from=1 to=#len(FileContent)# cfif asc(mid(FileContent, charcounter, 1)) GT 255 cfset FileContent = replace(FileContent, mid(FileContent, charcounter, 1), ?, all) /cfif /cfloop -- John Bliss - http://about.me/jbliss ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:352932 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: strip ntext chars
Is this a stumper? Or a stupid question? :-) On Thu, Oct 18, 2012 at 8:42 AM, John M Bliss bliss.j...@gmail.com wrote: Hi. I have a database column that is (for now) of type text. (For now) I cannot change it to ntext. What's the best way to use CF to strip out (or replace) characters that require ntext prior to inserting the text. Here's my first attempt which did not seem to work: cfloop index=charcounter from=1 to=#len(FileContent)# cfif asc(mid(FileContent, charcounter, 1)) GT 255 cfset FileContent = replace(FileContent, mid(FileContent, charcounter, 1), ?, all) /cfif /cfloop -- John Bliss - http://about.me/jbliss -- John Bliss - http://about.me/jbliss ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:352943 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: strip ntext chars
You're converting from Ntext to Text? Robert Harrison Director of Interactive Services Austin Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:352944 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: strip ntext chars
Reread your post. You may want to look at Ben Nadel's blog: http://www.bennadel.com/blog/1155-Cleaning-High-Ascii-Values-For-Web-Safeness-In-ColdFusion.htm Robert Harrison Director of Interactive Services Austin Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austi ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:352946 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: strip ntext chars
Oh, sweet! Thanks! (I owe Ben SO MANY BEERS. And, of course, Ray.) On Thu, Oct 18, 2012 at 12:34 PM, Robert Harrison rob...@austin-williams.com wrote: Reread your post. You may want to look at Ben Nadel's blog: http://www.bennadel.com/blog/1155-Cleaning-High-Ascii-Values-For-Web-Safeness-In-ColdFusion.htm Robert Harrison Director of Interactive Services Austin Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austi ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:352947 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: strip off HTML
Hi Raymond, thanks for your reply and your time (Thank you Andy too), due to the fact that this issue isn't important for my customer anymore, I am not investigating this further. But I did a final check on the mechanism. The routine itself is working quite well. What I have seen analysing is, that the raw data in the customer's field wasn't that nice (mixed HTML-data) after 50-60 lines which I didn't see from the beginning. So this could have caused it. Uwe There's quite a few things here a bit off. CFQUERY NAME=GetData datasource=1234 maxrows=1 Select ID,XYSHORTDESC FROM xyarticles /CFQUERY cfloop query=GetData startrow=1 endrow=#GetData.recordcount# cfsavecontent variable=str cfoutput#GetData.XYSHORTDESC#/cfoutput /cfsavecontent Why do you copy the value from the query into a new variable? You don't need to. cfset textstr = REReplace(str,'[^]*','','all') That line there could be: cfset textstr = REReplace(getDats.xyshortdesc,'[^]*','','all') Also, you can change the regex a bit: .*? CFSET textstr = LEFT(textstr,255) cfoutput #textstr# /cfoutput Ok, so at this point, is textstr ok? What do you see? The issues I mentioned above shouldn't actually make things not work. CFQUERY NAME=UpdateData datasource=1234 password=12345 username=frank update xyarticles set XYSHORTDESC = '#textstr#' where ID = '#GetData.ID#' /CFQUERY And again - you want to use cfqueryparam - but that shouldn't break stuff ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349871 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
strip off HTML
Hi list, with this code I want to strip off HTML coding of the field: XYSHORTDESC of a mySQL-table-field. It doesn't really work, since it is giving back blank fields after running, and I don't know why. Does anybody have a clue why or have an idea which ColdFusion function I can take to strip off HTML ro run it properly ? Thanks. Uwe CFQUERY NAME=GetData datasource=1234 maxrows=1 Select ID,XYSHORTDESC FROM xyarticles /CFQUERY cfloop query=GetData startrow=1 endrow=#GetData.recordcount# cfsavecontent variable=str cfoutput#GetData.XYSHORTDESC#/cfoutput /cfsavecontent cfset textstr = REReplace(str,'[^]*','','all') CFSET textstr = LEFT(textstr,255) cfoutput #textstr# /cfoutput CFQUERY NAME=UpdateData datasource=1234 password=12345 username=frank update xyarticles set XYSHORTDESC = '#textstr#' where ID = '#GetData.ID#' /CFQUERY ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349865 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: strip off HTML
There's quite a few things here a bit off. CFQUERY NAME=GetData datasource=1234 maxrows=1 Select ID,XYSHORTDESC FROM xyarticles /CFQUERY cfloop query=GetData startrow=1 endrow=#GetData.recordcount# cfsavecontent variable=str cfoutput#GetData.XYSHORTDESC#/cfoutput /cfsavecontent Why do you copy the value from the query into a new variable? You don't need to. cfset textstr = REReplace(str,'[^]*','','all') That line there could be: cfset textstr = REReplace(getDats.xyshortdesc,'[^]*','','all') Also, you can change the regex a bit: .*? CFSET textstr = LEFT(textstr,255) cfoutput #textstr# /cfoutput Ok, so at this point, is textstr ok? What do you see? The issues I mentioned above shouldn't actually make things not work. CFQUERY NAME=UpdateData datasource=1234 password=12345 username=frank update xyarticles set XYSHORTDESC = '#textstr#' where ID = '#GetData.ID#' /CFQUERY And again - you want to use cfqueryparam - but that shouldn't break stuff ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349866 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: strip off HTML
Uwe... At a guess, I'd say that the * might be a little too aggressive. Try a plus instead: cfset textstr = REReplace(str,'[^]+','','all') andy -Original Message- From: Uwe Degenhardt [mailto:cf-t...@sdsolutions.de] Sent: Sunday, February 12, 2012 8:53 AM To: cf-talk Subject: strip off HTML Hi list, with this code I want to strip off HTML coding of the field: XYSHORTDESC of a mySQL-table-field. It doesn't really work, since it is giving back blank fields after running, and I don't know why. Does anybody have a clue why or have an idea which ColdFusion function I can take to strip off HTML ro run it properly ? Thanks. Uwe CFQUERY NAME=GetData datasource=1234 maxrows=1 Select ID,XYSHORTDESC FROM xyarticles /CFQUERY cfloop query=GetData startrow=1 endrow=#GetData.recordcount# cfsavecontent variable=str cfoutput#GetData.XYSHORTDESC#/cfoutput /cfsavecontent cfset textstr = REReplace(str,'[^]*','','all') CFSET textstr = LEFT(textstr,255) cfoutput #textstr# /cfoutput CFQUERY NAME=UpdateData datasource=1234 password=12345 username=frank update xyarticles set XYSHORTDESC = '#textstr#' where ID = '#GetData.ID#' /CFQUERY ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349867 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex to strip out non-numerics but leave decimal point
Ok ... good. Thanks Nathan! On Tue, Jan 18, 2011 at 10:02 PM, Nathan Strutz str...@gmail.com wrote: [:digit:] seems like a lot of typing to just say \d, and why the extra character brackets around the outside? I would do this: reReplace(str, [^\d\.], , all) less typing = improvement nathan strutz [http://www.dopefly.com/] [http://hi.im/nathanstrutz] On Tue, Jan 18, 2011 at 1:04 PM, Jason Fisher ja...@wanax.com wrote: reReplace(rc.hourlyRateInvoicedToClient, [^[:digit:]\.], , all) A set [] takes all the options in it as options, so escape the . with \. and you should be good to go. From: Nando d.na...@gmail.com Sent: Tuesday, January 18, 2011 2:09 PM To: cf-talk cf-talk@houseoffusion.com Subject: Regex to strip out non-numerics but leave decimal point I'm trying to strip out all non-numeric characters from some fields. The catch is I need the regex to leave in the decimal point, cuz these are rates that include cents. rereplace(rc.hourlyRateInvoicedToClient,'[^[:digit:]]','','all') I'm not sure how to work something like [^\.] into it. Can anyone help? Thanks, Nando ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:341020 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Regex to strip out non-numerics but leave decimal point
I'm trying to strip out all non-numeric characters from some fields. The catch is I need the regex to leave in the decimal point, cuz these are rates that include cents. rereplace(rc.hourlyRateInvoicedToClient,'[^[:digit:]]','','all') I'm not sure how to work something like [^\.] into it. Can anyone help? Thanks, Nando ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340975 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
re: Regex to strip out non-numerics but leave decimal point
reReplace(rc.hourlyRateInvoicedToClient, [^[:digit:]\.], , all) A set [] takes all the options in it as options, so escape the . with \. and you should be good to go. From: Nando d.na...@gmail.com Sent: Tuesday, January 18, 2011 2:09 PM To: cf-talk cf-talk@houseoffusion.com Subject: Regex to strip out non-numerics but leave decimal point I'm trying to strip out all non-numeric characters from some fields. The catch is I need the regex to leave in the decimal point, cuz these are rates that include cents. rereplace(rc.hourlyRateInvoicedToClient,'[^[:digit:]]','','all') I'm not sure how to work something like [^\.] into it. Can anyone help? Thanks, Nando ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340980 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex to strip out non-numerics but leave decimal point
Thanks much Jason. On Tue, Jan 18, 2011 at 9:04 PM, Jason Fisher ja...@wanax.com wrote: reReplace(rc.hourlyRateInvoicedToClient, [^[:digit:]\.], , all) A set [] takes all the options in it as options, so escape the . with \. and you should be good to go. From: Nando d.na...@gmail.com Sent: Tuesday, January 18, 2011 2:09 PM To: cf-talk cf-talk@houseoffusion.com Subject: Regex to strip out non-numerics but leave decimal point I'm trying to strip out all non-numeric characters from some fields. The catch is I need the regex to leave in the decimal point, cuz these are rates that include cents. rereplace(rc.hourlyRateInvoicedToClient,'[^[:digit:]]','','all') I'm not sure how to work something like [^\.] into it. Can anyone help? Thanks, Nando ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340985 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex to strip out non-numerics but leave decimal point
[:digit:] seems like a lot of typing to just say \d, and why the extra character brackets around the outside? I would do this: reReplace(str, [^\d\.], , all) less typing = improvement nathan strutz [http://www.dopefly.com/] [http://hi.im/nathanstrutz] On Tue, Jan 18, 2011 at 1:04 PM, Jason Fisher ja...@wanax.com wrote: reReplace(rc.hourlyRateInvoicedToClient, [^[:digit:]\.], , all) A set [] takes all the options in it as options, so escape the . with \. and you should be good to go. From: Nando d.na...@gmail.com Sent: Tuesday, January 18, 2011 2:09 PM To: cf-talk cf-talk@houseoffusion.com Subject: Regex to strip out non-numerics but leave decimal point I'm trying to strip out all non-numeric characters from some fields. The catch is I need the regex to leave in the decimal point, cuz these are rates that include cents. rereplace(rc.hourlyRateInvoicedToClient,'[^[:digit:]]','','all') I'm not sure how to work something like [^\.] into it. Can anyone help? Thanks, Nando ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340987 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: strip alpha char
However, when using REReplace your forgetting the 'scope' attribute which lets you specify how many matches to replace. By specifying All you get them all. cfset NumbersOnly = ReReplace(Image12334blue1,[^\d],,All) This replaces everything that is not a Digit - Regex in this case is defining digits using \d. And using ^ for NOT. Thus [^\d] means not digits. I'm replacing non-digits with emtry string and setting the scope to ALL matches. Wil Genovese Sr. Web Application Developer ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315026 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: strip alpha char
Ops, I did that backwards... reReplace(myString, [\D], , all) On Fri, Nov 7, 2008 at 10:46 AM, Matt Quackenbush [EMAIL PROTECTED]wrote: reReplace(myString, [^A-Za-z], , all) ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314943 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: strip alpha char
REReplace() Adrian -Original Message- From: Chad Gray Sent: 07 November 2008 16:44 To: cf-talk Subject: strip alpha char I have a list of file names and I only want the numbers in the file names. I don't want any alpha characters. I can use RE to find the numbers, but it get complicated to find the starting position of the number and the ending of the numbers then using the mid function to get the number. Is there some magic CF function to take strings like this an strip the alpha character? Image12334blue Image12323red I want just the numbers: 12334 12323 ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314945 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: strip alpha char
Ah... REReplace... I only knew of REFind... THANKS! -Original Message- From: Matt Quackenbush [mailto:[EMAIL PROTECTED] Sent: Friday, November 07, 2008 11:50 AM To: cf-talk Subject: Re: strip alpha char Ops, I did that backwards... reReplace(myString, [\D], , all) On Fri, Nov 7, 2008 at 10:46 AM, Matt Quackenbush [EMAIL PROTECTED]wrote: reReplace(myString, [^A-Za-z], , all) ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314946 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: strip alpha char
String functions: http://livedocs.adobe.com/coldfusion/8/htmldocs/functions-pt0_18.html#1099887 :-) On Fri, Nov 7, 2008 at 10:57 AM, Chad Gray [EMAIL PROTECTED] wrote: Ah... REReplace... I only knew of REFind... THANKS! ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314948 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: strip alpha char
There's also REMatch (new in CF8) which returns the actual string matched instead of just the position of that string. -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Friday, November 07, 2008 10:57 AM To: cf-talk Subject: RE: strip alpha char Ah... REReplace... I only knew of REFind... THANKS! -Original Message- From: Matt Quackenbush [mailto:[EMAIL PROTECTED] Sent: Friday, November 07, 2008 11:50 AM To: cf-talk Subject: Re: strip alpha char Ops, I did that backwards... reReplace(myString, [\D], , all) On Fri, Nov 7, 2008 at 10:46 AM, Matt Quackenbush [EMAIL PROTECTED]wrote: reReplace(myString, [^A-Za-z], , all) ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314949 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
strip alpha char
I have a list of file names and I only want the numbers in the file names. I don't want any alpha characters. I can use RE to find the numbers, but it get complicated to find the starting position of the number and the ending of the numbers then using the mid function to get the number. Is there some magic CF function to take strings like this an strip the alpha character? Image12334blue Image12323red I want just the numbers: 12334 12323 ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314941 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: strip alpha char
Is there some magic CF function to take strings like this an strip the alpha character? With CF8 (and equiv) there is a new rematch function, which would allow: cfset NumbersOnly = rematch( 'Image12334blue' , '\d+' )/ Which is selecting the numbers rather than stripping the non-numbers. The difference in behaviour would be if you had non-consecutive numbers, e.g. Image12334blue1 - with the rereplace method, you would get 123341, but with rematch you get an array containing 12334 and 1. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314954 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: strip alpha char
reReplace(myString, [^A-Za-z], , all) On Fri, Nov 7, 2008 at 10:44 AM, Chad Gray [EMAIL PROTECTED] wrote: I have a list of file names and I only want the numbers in the file names. I don't want any alpha characters. I can use RE to find the numbers, but it get complicated to find the starting position of the number and the ending of the numbers then using the mid function to get the number. Is there some magic CF function to take strings like this an strip the alpha character? Image12334blue Image12323red I want just the numbers: 12334 12323 ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314942 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
strip all non-numeric characters from a string
We are having an issue with users entering their phone numbers and credit card info. How would I strip a string of all non-numeric characters. I'm sure it involves rereplace() but I'm no good with regular expressions. Thanks for any help. Right now for the credit card I have this which just strips out spaces and dashes: cfset attributes.billingCardNumber = replace(attributes.billingCardNumber, , , all) cfset attributes.billingCardNumber = replace(attributes.billingCardNumber, -, , all) ~| Create robust enterprise, web RIAs. Upgrade to ColdFusion 8 and integrate with Adobe Flex http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:286189 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: strip all non-numeric characters from a string
cfset foo = (555) 444-7890 / cfset foo = reReplace(foo, [^0-9], , all) / cfoutput#foo#/cfoutput [^0-9] means anything that is not the number 0 through 9. http://www.regular-expressions.info/ is a great start for learning Regular Expressions. HTH, Adrian We are having an issue with users entering their phone numbers and credit card info. How would I strip a string of all non-numeric characters. I'm sure it involves rereplace() but I'm no good with regular expressions. Thanks for any help. Right now for the credit card I have this which just strips out spaces and dashes: cfset attributes.billingCardNumber = replace(attributes. billingCardNumber, , , all) cfset attributes.billingCardNumber = replace(attributes. billingCardNumber, -, , all) ~| Enterprise web applications, build robust, secure scalable apps today - Try it now ColdFusion Today ColdFusion 8 beta - Build next generation apps Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:286192 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: strip all non-numeric characters from a string
cfset attributes.billingCardNumber = rereplace(attributes.billingCardNumber, '[^0-9]', '', 'all') / On 8/14/07, Matthew Smith [EMAIL PROTECTED] wrote: We are having an issue with users entering their phone numbers and credit card info. How would I strip a string of all non-numeric characters. I'm sure it involves rereplace() but I'm no good with regular expressions. Thanks for any help. Right now for the credit card I have this which just strips out spaces and dashes: cfset attributes.billingCardNumber = replace(attributes.billingCardNumber, , , all) cfset attributes.billingCardNumber = replace(attributes.billingCardNumber, -, , all) ~| Check out the new features and enhancements in the latest product release - download the What's New PDF now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:286194 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: strip all non-numeric characters from a string
num = REReplace(num, [^0-9]+, , all); cheers, barneyb On 8/14/07, Matthew Smith [EMAIL PROTECTED] wrote: We are having an issue with users entering their phone numbers and credit card info. How would I strip a string of all non-numeric characters. I'm sure it involves rereplace() but I'm no good with regular expressions. Thanks for any help. Right now for the credit card I have this which just strips out spaces and dashes: cfset attributes.billingCardNumber = replace(attributes.billingCardNumber, , , all) cfset attributes.billingCardNumber = replace(attributes.billingCardNumber, -, , all) -- Barney Boisvert [EMAIL PROTECTED] http://www.barneyb.com/ Got Gmail? I have 100 invites. ~| Download the latest ColdFusion 8 utilities including Report Builder, plug-ins for Eclipse and Dreamweaver updates. http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:286193 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: strip all non-numeric characters from a string
Did you attempt to search for this yourself first? A Google search for non numeric regex brings back over 60,000 results. Not trying to be mean, but you are expected to at least make an effort to solve the problem before you ask for help on a list. On 8/14/07, Matthew Smith [EMAIL PROTECTED] wrote: We are having an issue with users entering their phone numbers and credit card info. How would I strip a string of all non-numeric characters. I'm sure it involves rereplace() but I'm no good with regular expressions. Thanks for any help. Right now for the credit card I have this which just strips out spaces and dashes: cfset attributes.billingCardNumber = replace(attributes.billingCardNumber, , , all) cfset attributes.billingCardNumber = replace(attributes.billingCardNumber, -, , all) ~| Download the latest ColdFusion 8 utilities including Report Builder, plug-ins for Eclipse and Dreamweaver updates. http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:286196 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: strip all non-numeric characters from a string
I think you can also do num = REReplace(num, \D, , all); _ Jake Churchill CF Webtools 11204 Davenport, Ste. 200b Omaha, NE 68154 http://www.cfwebtools.com 402-408-3733 x103 -Original Message- From: Barney Boisvert [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 14, 2007 3:10 PM To: CF-Talk Subject: Re: strip all non-numeric characters from a string num = REReplace(num, [^0-9]+, , all); cheers, barneyb On 8/14/07, Matthew Smith [EMAIL PROTECTED] wrote: We are having an issue with users entering their phone numbers and credit card info. How would I strip a string of all non-numeric characters. I'm sure it involves rereplace() but I'm no good with regular expressions. Thanks for any help. Right now for the credit card I have this which just strips out spaces and dashes: cfset attributes.billingCardNumber = replace(attributes.billingCardNumber, , , all) cfset attributes.billingCardNumber = replace(attributes.billingCardNumber, -, , all) -- Barney Boisvert [EMAIL PROTECTED] http://www.barneyb.com/ Got Gmail? I have 100 invites. ~| Create robust enterprise, web RIAs. Upgrade to ColdFusion 8 and integrate with Adobe Flex http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:286195 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: strip all non-numeric characters from a string
I use the following UDF: cfscript function fnNumbersOnly(str) { return reReplace(str,[^[:digit:]],,all); } /cfscript -Original Message- From: Matthew Smith [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 14, 2007 3:47 PM To: CF-Talk Subject: strip all non-numeric characters from a string We are having an issue with users entering their phone numbers and credit card info. How would I strip a string of all non-numeric characters. I'm sure it involves rereplace() but I'm no good with regular expressions. Thanks for any help. Right now for the credit card I have this which just strips out spaces and dashes: cfset attributes.billingCardNumber = replace(attributes.billingCardNumber, , , all) cfset attributes.billingCardNumber = replace(attributes.billingCardNumber, -, , all) ~| Check out the new features and enhancements in the latest product release - download the What's New PDF now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:286197 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: strip all non-numeric characters from a string
Thanks to all that replied! -Original Message- From: Jake Churchill [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 14, 2007 3:16 PM To: CF-Talk Subject: RE: strip all non-numeric characters from a string I think you can also do num = REReplace(num, \D, , all); _ Jake Churchill CF Webtools 11204 Davenport, Ste. 200b Omaha, NE 68154 http://www.cfwebtools.com 402-408-3733 x103 -Original Message- From: Barney Boisvert [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 14, 2007 3:10 PM To: CF-Talk Subject: Re: strip all non-numeric characters from a string num = REReplace(num, [^0-9]+, , all); cheers, barneyb On 8/14/07, Matthew Smith [EMAIL PROTECTED] wrote: We are having an issue with users entering their phone numbers and credit card info. How would I strip a string of all non-numeric characters. I'm sure it involves rereplace() but I'm no good with regular expressions. Thanks for any help. Right now for the credit card I have this which just strips out spaces and dashes: cfset attributes.billingCardNumber = replace(attributes.billingCardNumber, , , all) cfset attributes.billingCardNumber = replace(attributes.billingCardNumber, -, , all) -- Barney Boisvert [EMAIL PROTECTED] http://www.barneyb.com/ Got Gmail? I have 100 invites. ~| Download the latest ColdFusion 8 utilities including Report Builder, plug-ins for Eclipse and Dreamweaver updates. http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:286203 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Strip HTML from a Collection
Actually for #2, you want to just use htmleditformat cfset cleantext = htmlEditFormat(queryname.column) On 4/30/07, Bobby Hartsfield [EMAIL PROTECTED] wrote: That depends. Do you mean just take it out completely or have it displayed as text? To take out all html tags you can use a regular expression like... cfset cleantext = rereplace(queryname.column, [^]*, , all) / To just make the html display as normal text just replace with lt; cfset cleantext = replace(queryname.column, , lt;, all) / Good luck -Original Message- From: Mark Flewellen [mailto:[EMAIL PROTECTED] Sent: Monday, April 30, 2007 10:09 PM To: CF-Talk Subject: Strip HTML from a Collection How do people on this list deal with stripping html a column in a query prior to loading the query into a coldfusion collection? ~| Upgrade to Adobe ColdFusion MX7 The most significant release in over 10 years. Upgrade see new features. http://www.adobe.com/products/coldfusion?sdid=RVJR Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:276595 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Strip HTML from a Collection
You can use what the previous guy said - and replace or escape the html as you want when outputting your search. You may also want to consider this post: http://ray.camdenfamily.com/index.cfm/2007/4/17/Quick-example-of-cleaning-up-Verity-results On 4/30/07, Mark Flewellen [EMAIL PROTECTED] wrote: The problem I am having is I load the data in including the html content via the query attribute in cfindex. When I output a summary sometimes it gets cut of through a tag. This is what I do to index cfindex collection=news action=refresh type=custom query=qry_NewsList key=newsid title=title body=content,title Mark -- === Raymond Camden Email: [EMAIL PROTECTED] Blog : ray.camdenfamily.com AOL IM : cfjedimaster Video game player? Have kids? Check out KidGamers.org ~| Macromedia ColdFusion MX7 Upgrade to MX7 experience time-saving features, more productivity. http://www.adobe.com/products/coldfusion?sdid=RVJW Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:276596 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Strip HTML from a Collection
That too :-) Cheers, Previous Guy -Original Message- From: Raymond Camden [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 01, 2007 7:05 AM To: CF-Talk Subject: Re: Strip HTML from a Collection Actually for #2, you want to just use htmleditformat cfset cleantext = htmlEditFormat(queryname.column) On 4/30/07, Bobby Hartsfield [EMAIL PROTECTED] wrote: That depends. Do you mean just take it out completely or have it displayed as text? To take out all html tags you can use a regular expression like... cfset cleantext = rereplace(queryname.column, [^]*, , all) / To just make the html display as normal text just replace with lt; cfset cleantext = replace(queryname.column, , lt;, all) / Good luck -Original Message- From: Mark Flewellen [mailto:[EMAIL PROTECTED] Sent: Monday, April 30, 2007 10:09 PM To: CF-Talk Subject: Strip HTML from a Collection How do people on this list deal with stripping html a column in a query prior to loading the query into a coldfusion collection? ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:276619 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Strip HTML from a Collection
Thanks guys what I was wanting was to clean it before it was indexed though, and the only way i can think of doing this is to strip the query using regex then rebuild the query and load this into cfindex. Would this be correct way to deal with this problem? ~| ColdFusion MX7 and Flex 2 Build sales marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:276689 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Strip HTML from a Collection
How do people on this list deal with stripping html a column in a query prior to loading the query into a coldfusion collection? ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:276586 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Strip HTML from a Collection
That depends. Do you mean just take it out completely or have it displayed as text? To take out all html tags you can use a regular expression like... cfset cleantext = rereplace(queryname.column, [^]*, , all) / To just make the html display as normal text just replace with lt; cfset cleantext = replace(queryname.column, , lt;, all) / Good luck -Original Message- From: Mark Flewellen [mailto:[EMAIL PROTECTED] Sent: Monday, April 30, 2007 10:09 PM To: CF-Talk Subject: Strip HTML from a Collection How do people on this list deal with stripping html a column in a query prior to loading the query into a coldfusion collection? ~| Upgrade to Adobe ColdFusion MX7 The most significant release in over 10 years. Upgrade see new features. http://www.adobe.com/products/coldfusion?sdid=RVJR Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:276587 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Strip HTML from a Collection
The problem I am having is I load the data in including the html content via the query attribute in cfindex. When I output a summary sometimes it gets cut of through a tag. This is what I do to index cfindex collection=news action=refresh type=custom query=qry_NewsList key=newsid title=title body=content,title Mark ~| Create Web Applications With ColdFusion MX7 Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:276591 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
=?iso-8859-1?Q?Re: how can I strip a UK =A3 sign from a u rl variable??=
then you're pre-cf7. what version of cf? this is just locally, testing it. However cf7 on the host gives the same type error after setting to setLocale(en_GB) - btw, moving to BD shortly if that makes a difference. Parameter 1, �66.16, of function LSParseCurrency is an invalid currency value in the current locale. what encoding is the page that produced the url value, the page accepting it, I have no idea, sorry, I guess the default. etc.? have you tried urlDecode on those url vars? -just did, same error. Hm.. ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 MX7 integration create powerful cross-platform RIAs http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274818 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
=?iso-8859-1?Q?Re: how can I strip a UK =A3 sign from a u rl variable??=
using cf7, utf-8, that snippet works fine. I checked GetEncoding(URL) and it said utf-8 ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274821 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
=?iso-8859-1?Q?Re: Re: how can I strip a UK =A3 sign from a u rl variable??=
stylo stylo wrote: However cf7 on the host gives the same type error after setting to setLocale(en_GB) - btw, moving to BD shortly if that makes a difference. no, it cannot give the same error, cf7 accepts java style locales. your host is using a cf version prior to 7. I have no idea, sorry, I guess the default. if your host is cf6/7 then it should be utf-8 but that depends on if someone changed the server encoding. could be the reverse case, latin-1 or whatever encoding coming in via your url utf-8 on the cf page. try adding cfprocessingDirective pageEncoding=iso-8859-1 to the top of that snippet. if that doesn't fix it, then it might be whatever encoding. i guess then try windows-1252 codepage. ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274824 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
=?iso-8859-1?Q?Re: Re: how can I strip a UK =A3 sign from a u rl variable??=
stylo stylo wrote: using cf7, utf-8, that snippet works fine. I checked GetEncoding(URL) and it said utf-8 and did you set it previously? in any case that's what cf's expecting/using not what the other app's producing. can you post the entire url var or point to a public page that exhibits the problem? ~| Create Web Applications With ColdFusion MX7 Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274825 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
=?iso-8859-1?Q?Re: how can I strip a UK =A3 sign from a u rl variable??=
Nothing worked so ended up regexing them and resetting them. Thanks for the help anyway. ~| Macromedia ColdFusion MX7 Upgrade to MX7 experience time-saving features, more productivity. http://www.adobe.com/products/coldfusion?sdid=RVJW Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274826 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
=?iso-8859-1?Q?Re: how can I strip a UK =A3 sign from a u rl variable??=
However cf7 on the host gives the same type error Just to clarify, I meant the same ?66 is not a number error, not a locale error. ~| ColdFusion MX7 and Flex 2 Build sales marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274827 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
=?iso-8859-1?Q?Re: how can I strip a UK =A3 sign from a u rl variable??=
setLocale(en_GB); pounds=lsParseCurrency(url. currencyVar); That local it says doesn't exist and gives an error. I used setLocale(English (UK)) but I still get: Parameter 1, �6.16, of function LSParseCurrency is an invalid currency value in the current locale. Ideas? ~| Upgrade to Adobe ColdFusion MX7 The most significant release in over 10 years. Upgrade see new features. http://www.adobe.com/products/coldfusion?sdid=RVJR Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274792 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
=?iso-8859-1?Q?Re: Re: how can I strip a UK =A3 sign from a u rl variable??=
stylo stylo wrote: That local it says doesn't exist and gives an error. then you're pre-cf7. what version of cf? Parameter 1, �6.16, of function LSParseCurrency is an invalid currency value in the current locale. what encoding is the page that produced the url value, the page accepting it, etc.? have you tried urlDecode on those url vars? using cf7, utf-8, that snippet works fine. i can however reproduce your error by changing the cf page encoding to iso-8859-1 (though the text is still utf-8). any public place i can see this url goop? ~| Macromedia ColdFusion MX7 Upgrade to MX7 experience time-saving features, more productivity. http://www.adobe.com/products/coldfusion?sdid=RVJW Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274793 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
=?iso-8859-1?Q?how can I strip a UK =A3 sign from aurl va riable?3F?=3D?=
I'm stuck trying to strip a UK pound symbol £ from url variables. I've tried a bunch of things but just keep getting an error like ?50 cannot be converted to a number. Tried stripping the symbol itself, %A3 which shows up in the address bar after entering it (think this is server dependent?), and a question mark. Nothing works. I did get stripping %A3 from cgi.QUERY_STRING to work and I could rewrite all the variables from that but hoping for something direct and easier. Ideas? I can't do anything about the symbol being in there, coming from a dumb program elsewhere. Thanks. ~| Macromedia ColdFusion MX7 Upgrade to MX7 experience time-saving features, more productivity. http://www.adobe.com/products/coldfusion?sdid=RVJW Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274665 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
=?iso-8859-1?Q?Re: how can I strip a UK =A3 sign from aurl va riable?3F3D?=3D?=
stylo stylo wrote: Ideas? I can't do anything about the symbol being in there, coming from a dumb program elsewhere. setLocale(en_GB); pounds=lsParseCurrency(url.currencyVar); ~| ColdFusion MX7 and Flex 2 Build sales marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274666 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: How to strip a #
how about this... cfset foo = replace(bar, #Chr(35)#, , all/ Or even more simply: cfset foo = replace(bar, Chr(35), , all ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260177 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: How to strip a #
cfset foo = replace(bar, Chr(35), , all Yeah...that's what someone else suggested, but it didn't work...and I found (in the past sometime) that to make replacements using the Chr references that I had to put quotes and #'s around the Chr(35) to get it to work. I've don't it like that a long time and it may not be really necessary, but it became the habit. I'll have to check it out again with the s and #'s. Thought I'd venture out of always asking questions to possibly try to offer an answer to someone. I'm not sure what the final solution was, however... Rick -Original Message- From: Claude Schneegans [mailto:[EMAIL PROTECTED] Sent: Monday, November 13, 2006 9:57 AM To: CF-Talk Subject: Re: How to strip a # how about this... cfset foo = replace(bar, #Chr(35)#, , all/ Or even more simply: cfset foo = replace(bar, Chr(35), , all ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260185 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: How to strip a #
Sorry, Rick, haven't tried this yet, got distracted on a different problem. Will let you know! On 11/13/06, Rick Faircloth [EMAIL PROTECTED] wrote: cfset foo = replace(bar, Chr(35), , all Thought I'd venture out of always asking questions to possibly try to offer an answer to someone. I'm not sure what the final solution was, however... Rick ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260186 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: How to strip a #
cfset foo = hello##goodbye !--- results in 'hello#goodbye' --- cfset bar = replace(foo, Chr(35), , all) cfoutput foo: #foo# br / bar: #bar# /cfoutput Works just fine On 11/13/06, John Cox [EMAIL PROTECTED] wrote: Sorry, Rick, haven't tried this yet, got distracted on a different problem. Will let you know! On 11/13/06, Rick Faircloth [EMAIL PROTECTED] wrote: cfset foo = replace(bar, Chr(35), , all Thought I'd venture out of always asking questions to possibly try to offer an answer to someone. I'm not sure what the final solution was, however... Rick ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260192 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: How to strip a #
Echo -Original Message- From: Claude Schneegans [mailto:[EMAIL PROTECTED] Sent: 13 November 2006 14:57 To: CF-Talk Subject: Re: How to strip a # how about this... cfset foo = replace(bar, #Chr(35)#, , all/ Or even more simply: cfset foo = replace(bar, Chr(35), , all ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260197 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: How to strip a #
Yeah...that's what someone else suggested, but it didn't work... Ahhh..., may be not under CF 4.0 ;-) -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260201 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: How to strip a #
Thanks all for the help on this. I think I am looking at the problem just a bit wrong, because all the suggestions should work, but none are. I'm going to attack the problem from a different angle. Once again, thanks for the suggestions! ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260208 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
How to strip a #
I am trying to strip out a # (pound) from a string. I would have thought this would have worked: cfset foo = replace(bar, #, , all) / That didn't work, as it thought it was a var (missing an argument). I tried to escape it: cfset foo = replace(bar, ##, , all) / But that didn't seem to work (i think it is looking for ## at that point). Any suggestions? ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260132 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: How to strip a #
Try this cfset foo = replace(bar, chr(35), , all) / -- Russ Michaels -Original Message- From: John Cox [mailto:[EMAIL PROTECTED] Sent: 13 November 2006 00:51 To: CF-Talk Subject: How to strip a # I am trying to strip out a # (pound) from a string. I would have thought this would have worked: cfset foo = replace(bar, #, , all) / That didn't work, as it thought it was a var (missing an argument). I tried to escape it: cfset foo = replace(bar, ##, , all) / But that didn't seem to work (i think it is looking for ## at that point). Any suggestions? ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260134 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: How to strip a #
On 11/12/06, Snake [EMAIL PROTECTED] wrote: Try this cfset foo = replace(bar, chr(35), , all) / hmm, that doesn't work either, seems like it should though. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260135 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: How to strip a #
Assuming the Chr(35) is correct for a #, how about this... cfset foo = replace(bar, #Chr(35)#, , all/ -Original Message- From: John Cox [mailto:[EMAIL PROTECTED] Sent: Sunday, November 12, 2006 8:13 PM To: CF-Talk Subject: Re: How to strip a # On 11/12/06, Snake [EMAIL PROTECTED] wrote: Try this cfset foo = replace(bar, chr(35), , all) / hmm, that doesn't work either, seems like it should though. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260136 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: How to strip a #
3 solutions (including one of your own original ones) work for replacing #'s. maybe you should take a closer look at the contents of foo? -Original Message- From: Rick Faircloth [mailto:[EMAIL PROTECTED] Sent: Sunday, November 12, 2006 9:36 PM To: CF-Talk Subject: RE: How to strip a # Assuming the Chr(35) is correct for a #, how about this... cfset foo = replace(bar, #Chr(35)#, , all/ -Original Message- From: John Cox [mailto:[EMAIL PROTECTED] Sent: Sunday, November 12, 2006 8:13 PM To: CF-Talk Subject: Re: How to strip a # On 11/12/06, Snake [EMAIL PROTECTED] wrote: Try this cfset foo = replace(bar, chr(35), , all) / hmm, that doesn't work either, seems like it should though. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260141 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: How to strip a #
Ah... why not just escape it by doubling up? cfset foo = replace(bar, ##, , all) / Cheers, !k -Original Message- From: John Cox [mailto:[EMAIL PROTECTED] Sent: Sunday, November 12, 2006 6:51 PM To: CF-Talk Subject: How to strip a # I am trying to strip out a # (pound) from a string. I would have thought this would have worked: cfset foo = replace(bar, #, , all) / That didn't work, as it thought it was a var (missing an argument). I tried to escape it: cfset foo = replace(bar, ##, , all) / But that didn't seem to work (i think it is looking for ## at that point). Any suggestions? ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260142 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Strip dots out of ip address
All, I'm trying to strip the dots out of ip addresses. I'm trying to use it as part of a unique numeric value for e-mail confirmation. 69.124.49.27 Thanks. D ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244906 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Strip dots out of ip address
replace(yoyoma, '.', '', 'all') - Original Message - From: [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Tuesday, June 27, 2006 4:33 PM Subject: Strip dots out of ip address All, I'm trying to strip the dots out of ip addresses. I'm trying to use it as part of a unique numeric value for e-mail confirmation. 69.124.49.27 Thanks. D ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244907 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
RE: Strip dots out of ip address
Replace( 69.124.49.27, ., , ALL ) Also, Michael Dinowitz had a good piece of code that actually converted the IP into an integer. I can't remember what it was but I think it basically converts from base 2 to base 10 or something... Maybe he can post it (please). ... Ben Nadel Web Developer Nylon Technology 350 7th Avenue Floor 10 New York, NY 10001 212.691.1134 x 14 212.691.3477 fax www.nylontechnology.com Some people call me the space cowboy. Some people call me the gangster of love. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 27, 2006 4:33 PM To: CF-Talk Subject: Strip dots out of ip address All, I'm trying to strip the dots out of ip addresses. I'm trying to use it as part of a unique numeric value for e-mail confirmation. 69.124.49.27 Thanks. D ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244908 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Strip dots out of ip address
cfset newip = replace(ipAddress,.,,all) / ? On 27/06/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: All, I'm trying to strip the dots out of ip addresses. I'm trying to use it as part of a unique numeric value for e-mail confirmation. 69.124.49.27 Thanks. D ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244909 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Strip dots out of ip address
No need for anything fancy there: cfscript strIP = '69.124.49.27'; strOut = replace(strIP,'.','','ALL'); writeOutput(strOut); /cfscript Best, Phillip Holmes Quoting [EMAIL PROTECTED]: All, I'm trying to strip the dots out of ip addresses. I'm trying to use it as part of a unique numeric value for e-mail confirmation. 69.124.49.27 Than ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244910 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Strip dots out of ip address
I'm trying to strip the dots out of ip addresses. I'm trying to use it as part of a unique numeric value for e-mail confirmation. 69.124.49.27 IP address dotted-quad values can be converted directly into integers: http://www.cflib.org/udf.cfm?ID=946 I wouldn't recommend just removing the dots, because you could conceivably encounter some wackiness when comparing addresses from networks of different classes. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244914 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Strip dots out of ip address
In order to be more-careful with this, you should make sure that you have three digits for each part. For example: 069.124.049.027 Would give you: 069124049027 Without padding the numbers, you could have: 691244927 Many IP addresses, with low values, could cause duplication. M!ke -Original Message- From: Phillip B. Holmes [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 27, 2006 3:42 PM To: CF-Talk Subject: Re: Strip dots out of ip address No need for anything fancy there: cfscript strIP = '69.124.49.27'; strOut = replace(strIP,'.','','ALL'); writeOutput(strOut); /cfscript Best, Phillip Holmes ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244917 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
Re: Strip dots out of ip address
On 6/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm trying to use it as part of a unique numeric value for e-mail confirmation. Be careful though. IP addresses can change all the time. I rebooted today and got a different one. Cheers, Sam ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244919 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Sot: FCKeditor help - strip out script tags...
How can I strip out script tags? I want users to be able to edit the HTML source, using fckeditor, but I want to disallow certain tags, and scrub them out before submitting my form Any ideas? Thanks Dov NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:239512 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: FCKeditor help - strip out script tags...
I am not 100% familiar with the FCK editor (we use the Xstandard editor here... www.xstandard.com)... But my guess would be that in Javascript, you can strip out the tags after you grab the value from the form field that FCK editor saves to... Someone else here can talk about how that happens, but as far as stripping, it might look like this: strContent = objInput.value; strContent = strContent.replace( new RegExp(script[^]*((?!/script)[\w\W])*/script[^]*, gim), ); Now, the strContent javascript variable should have no script tags. ... Ben Nadel www.bennadel.com -Original Message- From: Katz, Dov B (IT) [mailto:[EMAIL PROTECTED] Sent: Thursday, May 04, 2006 11:38 AM To: CF-Talk Subject: Sot: FCKeditor help - strip out script tags... How can I strip out script tags? I want users to be able to edit the HTML source, using fckeditor, but I want to disallow certain tags, and scrub them out before submitting my form Any ideas? Thanks Dov NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:239518 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: FCKeditor help - strip out script tags...
Before you commit the form field input, scrub it like this, which assumes your edit field is form.richText cfset form.richText = REReplaceNoCase(form.richText, (SCRIPT[^]*)(.*(/SCRIPT[^]*))?, , ALL) Then do what you will with form.richText (i.e. save it in a db table). [EMAIL PROTECTED] Janitor, MSB Web Systems http://mysecretbase.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:239529 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Sot: FCKeditor help - strip out script tags...
Ooo! FCK Rocks! It's got some built-in stuff for stripping tags, but I wouldn't hesitate to add some sort of server-side check as well (regular expression perhaps). Check the fckconfig.js for the FCKEditor settings (next to ASP and PHP stripping settings), and regular-expressions.com has a nice example of tag-based regex stripping. Coldfusion will also do this for you, to the consternation of many a wannabe-JavaScript-in-the-database-includer. Can't remember which setting it is specifically, maybe the cross-site scripting one? :| )3|\| On 5/4/06, Katz, Dov B (IT) [EMAIL PROTECTED] wrote: How can I strip out script tags? I want users to be able to edit the HTML source, using fckeditor, but I want to disallow certain tags, and scrub them out before submitting my form Any ideas? Thanks Dov NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:239586 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
Re: Regular Expressions - Strip HTML tags. Please help!!!
Thank you guys for pointing me to the right direction. The udf StripTags is really god sent. Thanks cfcoder CFLib.org is your friend :) Check out the function called StripTags. It does exactly what you want. http://www.cflib.org/udf.cfm?ID=774 Cedric ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238004 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Regular Expressions - Strip HTML tags. Please help!!!
Hello Everybody, I need your help with regular expressions. I'm trying to strip out HTML tags from a string to pass it to a flash movie. I've found a script that does this but the problem is that I want to keep some html formatting specifically the following tags: b, br, span, i, strong, div, p Here is the code: cfscript function StripHTML(str) { return REReplaceNoCase(str,[^]*,br,ALL); } /cfscript cfset logtext = table trtdpspan class=bodyThis is some example text/span/p/td/tr trtdbFriday 17 march, 2006/bbr12:54 PM/td/tr /table cfset str = StripHTML(logtext) The above script strips out the everything between the opening and closing angle brackets and . Is there any way to tell the regular expression to do the above but not process the following tags: b, br, span, i, strong, div, p I would be really greatful if someone could post the regular expression to do this. Best regards, cfcoder ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237683 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
Re: Regular Expressions - Strip HTML tags. Please help!!!
You may have to use a negative lookahead. Try something like this: (?!\/?(br|b|span|i|strong|div|p))[^]* This hasn't been tested and is purely from memory, but I think that (or something close to it) should remove any tag that is *NOT* the open or closing tag of one you listed. For more information on negative lookaheads you can look at the livedocs or google 'regex negative lookahead'. hth. On 4/13/06, cf coder [EMAIL PROTECTED] wrote: Hello Everybody, I need your help with regular expressions. I'm trying to strip out HTML tags from a string to pass it to a flash movie. I've found a script that does this but the problem is that I want to keep some html formatting specifically the following tags: b, br, span, i, strong, div, p Here is the code: cfscript function StripHTML(str) { return REReplaceNoCase(str,[^]*,br,ALL); } /cfscript cfset logtext = table trtdpspan class=bodyThis is some example text/span/p/td/tr trtdbFriday 17 march, 2006/bbr12:54 PM/td/tr /table cfset str = StripHTML(logtext) The above script strips out the everything between the opening and closing angle brackets and . Is there any way to tell the regular expression to do the above but not process the following tags: b, br, span, i, strong, div, p I would be really greatful if someone could post the regular expression to do this. Best regards, cfcoder ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237697 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Regular Expressions - Strip HTML tags. Please help!!!
Not sure if this has been suggested (coming in late), but this function works well. http://www.cflib.org/udf.cfm?ID=774 (Thanks Isaac) Not a simple regex, but it gets the job done. On 4/13/06, cf coder [EMAIL PROTECTED] wrote: Hello Everybody, I need your help with regular expressions. I'm trying to strip out HTML tags from a string to pass it to a flash movie. I've found a script that does this but the problem is that I want to keep some html formatting specifically the following tags: b, br, span, i, strong, div, p ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237699 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Regular Expressions - Strip HTML tags. Please help!!!
Yeah I hawked it. :P Thanks Jerry. I love that people like this function so much, it makes me smile whenever I see it recommended, because I know I've helped them. :) I wrote an article for CFDJ that should be in the next issue(?) about an alternative approach of using XML and a CFC to handle user-provided xhtml content and remove tags. Not sure if this has been suggested (coming in late), but this function works well. http://www.cflib.org/udf.cfm?ID=774 (Thanks Isaac) Not a simple regex, but it gets the job done. On 4/13/06, cf coder [EMAIL PROTECTED] wrote: Hello Everybody, I need your help with regular expressions. I'm trying to strip out HTML tags from a string to pass it to a flash movie. I've found a script that does this but the problem is that I want to keep some html formatting specifically the following tags: b, br, span, i, strong, div, p s. isaac dealey 434.293.6201 new epoch : isn't it time for a change? add features without fixtures with the onTap open source framework http://www.fusiontap.com http://coldfusion.sys-con.com/author/4806Dealey.htm ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237703 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Regular Expressions - Strip HTML tags. Please help!!!
CFLib.org is your friend :) Check out the function called StripTags. It does exactly what you want. http://www.cflib.org/udf.cfm?ID=774 Cedric ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237707 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Regular Expressions - Strip HTML tags. Please help!!!
HI cfCoder You could try something along these lines: reReplaceNoCase(str,(font)[^]*,,all) replaceNoCase(returnStr,/font,,all) You could then be selective to the tags you wish to strip out. Hope this helps. All the best Jose Diaz On 4/13/06, cf coder [EMAIL PROTECTED] wrote: Hello Everybody, I need your help with regular expressions. I'm trying to strip out HTML tags from a string to pass it to a flash movie. I've found a script that does this but the problem is that I want to keep some html formatting specifically the following tags: b, br, span, i, strong, div, p Here is the code: cfscript function StripHTML(str) { return REReplaceNoCase(str,[^]*,br,ALL); } /cfscript cfset logtext = table trtdpspan class=bodyThis is some example text/span/p/td/tr trtdbFriday 17 march, 2006/bbr12:54 PM/td/tr /table cfset str = StripHTML(logtext) The above script strips out the everything between the opening and closing angle brackets and . Is there any way to tell the regular expression to do the above but not process the following tags: b, br, span, i, strong, div, p I would be really greatful if someone could post the regular expression to do this. Best regards, cfcoder ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237725 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Strip $ and , from entered numbers
Trying to turn $123,456 into 123456 Getting rid of the $ sign is easy... #Replace(mynumber, $, , ALL)# But I'm not sure how to kill the $ and the , at the same time with the least amount of fuss... ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:235711 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Strip $ and , from entered numbers
rereplace(myNumber, '[$,]', '', 'all') On 3/18/06, Les Mizzell [EMAIL PROTECTED] wrote: Trying to turn $123,456 into 123456 Getting rid of the $ sign is easy... #Replace(mynumber, $, , ALL)# But I'm not sure how to kill the $ and the , at the same time with the least amount of fuss... ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:235712 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
Re: Strip $ and , from entered numbers
I must confess to being a regex beginner so it might not be the most elegant way but cfset num = $123,456 cfset newnum = rereplace(num,[^[:digit:]],,ALL) cfoutput#num#,#newnum#/cfoutput On 3/18/06, Les Mizzell [EMAIL PROTECTED] wrote: Trying to turn $123,456 into 123456 Getting rid of the $ sign is easy... #Replace(mynumber, $, , ALL)# But I'm not sure how to kill the $ and the , at the same time with the least amount of fuss... -- Mike T Blog http://www.socialpoints.com/ ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:235713 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Strip $ and , from entered numbers
Michael Traher wrote: I must confess to being a regex beginner so it might not be the most elegant way but cfset num = $123,456 cfset newnum = rereplace(num,[^[:digit:]],,ALL) cfoutput#num#,#newnum#/cfoutput This would probably work better than the other option because the other option only removes the $ and , ... where this one strips all non-digit characters. I probably wouldn't have thought of this one, myself. you'd have to get a little trickier if you want to keep decimal points =) Rick ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:235716 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
RE: Strip $ and , from entered numbers
From: Les Mizzell [mailto:[EMAIL PROTECTED] Trying to turn $123,456 into 123456 Getting rid of the $ sign is easy... #Replace(mynumber, $, , ALL)# But I'm not sure how to kill the $ and the , at the same time with the least amount of fuss... Les, I just solved the same problem for a form I was working on. I needed to strip out anything EXCEPT digits and a period. I used the following: var _regEx = /[^0-9\.]*/g; var _br = document.offerLetterRequest.billRate.value; var _billRate = ( isNaN(parseFloat(_br.replace(_regEx,''))) ) ? 0.00 : parseFloat(_br.replace(_regEx,'')); You can take the above regex and use it in CF without too much difficulty. HTH, Tango ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:235718 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Strip Email function
S. Isaac Dealey wrote: Why would you strip those characters out rather than just use an isEmail() function and refuse to accept invalid input? How about: isVALID(email,#form.email#) Damn it, looks like I need to read the CFMX7 function and tag list again! I didn't know about this one. What a great function! Of course, I have CFMX7 here at work and on my own server, so I can use stuff like that for my own apps but most of the stuff I develop for open source I try to stick to CFMX 6.1 compatible so I end up using the isEmail() function from cflib anyway. Rick ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:235003 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Strip Email function
Hi all, I have just created a simple function to remove characters that may cause the cfmail tag to crash... cfcomponent cffunction name=strip_email output=false access=public returntype=string cfargument name=email type=string required=true !--- remove void characters from email address --- cfset new_email = ReplaceNoCase(arguments.email, ,, ., ALL) cfset new_email = ReplaceNoCase(new_email, , , ALL) cfset new_email = REReplaceNoCase(new_email, ()|(), , ALL) cfset new_email = REReplaceNoCase(new_email, !, , ALL) cfset new_email = REReplaceNoCase(new_email, \?, , ALL) cfset new_email = REReplaceNoCase(new_email, \^, , ALL) cfset new_email = REReplaceNoCase(new_email, \$, , ALL) cfset new_email = REReplaceNoCase(new_email, %, , ALL) cfset new_email = REReplaceNoCase(new_email, , , ALL) cfset new_email = REReplaceNoCase(new_email, \*, , ALL) cfset new_email = REReplaceNoCase(new_email, (\[)|(\]), , ALL) cfset new_email = REReplaceNoCase(new_email, (\{)|(\}), , ALL) cfreturn new_email/ /cffunction /cfcomponent Can anyone think of some obvious items I am missing with this? I also use the following javascript when the form is submitted... script language=JavaScript type=text/javascript function validateForm(passForm) { if (passForm.email.value == ) { alert (Please enter a valid email address.); passForm.email.focus(); return false; } if (passForm.email.value.indexOf('@',0) == -1 || passForm.email.value.indexOf('@',0) == 0 || passForm.email.value.indexOf('.',0) == -1) { alert (Please make sure your email address has been entered in the correct format.); passForm.email.select(); passForm.email.focus(); return false; } return true; } /script mike ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234952 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Strip Email function
Mike | NZSolutions Ltd wrote: Hi all, I have just created a simple function to remove characters that may cause the cfmail tag to crash... Why would you strip those characters out rather than just use an isEmail() function and refuse to accept invalid input? Seems kinda silly to strip content from email addresses. http://www.cflib.org/udf.cfm?ID=216 Rick ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234958 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Strip Email function
Why would you strip those characters out rather than just use an isEmail() function and refuse to accept invalid input? How about: isVALID(email,#form.email#) Works good for me... ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234967 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
Re: Strip Email function
How about: isVALID(email,#form.email#) Shouldn't that be isValid(email,form.email) ? Probably! It's late and my last cup of coffee has worn off! ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234981 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
Strip HTML from string except for specified...
Have you looked over at CFLib.org? There's lots of those types of functions there. !//-- andy matthews web developer ICGLink, Inc. [EMAIL PROTECTED] 615.370.1530 x737 --//- -Original Message- From: Oleg Gunkin [mailto:[EMAIL PROTECTED] Sent: Friday, March 03, 2006 1:27 PM To: CF-Talk Subject: RE: using WHERE with ValueList? Can anyone help me to find a function tha strips all html from a string except for the tags I specify. For example, I want to only allow a, p, h*, and img tags, and strip everything else. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234092 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Strip HTML and display
I'm having trouble displaying a large chunk of text properly. Basically, the text looks something like: This is a test b style=color:redwith/b some test that will wrap around the different lines. I b style=color:red;text-decoration:none want more text here/b Essentially, I want to take out all of the HTML tags and redisplay the text. Problem is that just removing the HTML results in the following being displayed: this is a test with some text that will wrap around the different lines. I more text here. This doesn't look so hot. How can I get the some text... to appear on the previous line, and also the more text here to appear on the previous line. I'm trying to make this look like seamless text, but right now it looks like broken chunks with obvious data removed. Ideally, I'd like all the text on 1 line, that I can then wrap later myself. My initial attemps of removing carriage returns first, stripping HTML, then re-adding CR's didn't work as the real CR's were lost. Any ideas? Cedric ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230793 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Strip HTML and display
Not quite sure what you are trying to accomplish, but I'll give it a whack. Are you saying that any CR that happens right after a tag should not happen, then: !--- replace all tag/newlines with just tags --- cfset newString=rereplace(str,[#chr(10)##chr(13)#]+,,ALL) !--- remove all tags --- cfset newString=rereplace(newString,[^]*,,ALL) On 1/30/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm having trouble displaying a large chunk of text properly. Basically, the text looks something like: This is a test b style=color:redwith/b some test that will wrap around the different lines. I b style=color:red;text-decoration:none want more text here/b Essentially, I want to take out all of the HTML tags and redisplay the text. Problem is that just removing the HTML results in the following being displayed: this is a test with some text that will wrap around the different lines. I more text here. This doesn't look so hot. How can I get the some text... to appear on the previous line, and also the more text here to appear on the previous line. I'm trying to make this look like seamless text, but right now it looks like broken chunks with obvious data removed. Ideally, I'd like all the text on 1 line, that I can then wrap later myself. My initial attemps of removing carriage returns first, stripping HTML, then re-adding CR's didn't work as the real CR's were lost. Any ideas? Cedric ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230794 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Strip HTML and display
My desired output didn't show up quite right. Anyway, I'm not trying to get rid of CR's after tags. Basically, this text has already been wrapped at some length (65 chars). The problem is it was wrapped text was wrapped while taking into account the HTML. I'm trying to unwrap the text, then remove the HTML, then re-wrap it so that the text displays properly. Cedric Not quite sure what you are trying to accomplish, but I'll give it a whack. Are you saying that any CR that happens right after a tag should not happen, then: !--- replace all tag/newlines with just tags --- cfset newString=rereplace(str,[#chr(10)##chr(13)#]+,,ALL) !--- remove all tags --- cfset newString=rereplace(newString,[^]*,,ALL) On 1/30/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230798 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Strip HTML and display
This might help solve your problem: http://www.cflib.org/udf.cfm?ID=249 M!ke -Original Message- From: Cedric Villat [mailto:[EMAIL PROTECTED] Sent: Monday, January 30, 2006 7:23 PM To: CF-Talk Subject: Re: Strip HTML and display My desired output didn't show up quite right. Anyway, I'm not trying to get rid of CR's after tags. Basically, this text has already been wrapped at some length (65 chars). The problem is it was wrapped text was wrapped while taking into account the HTML. I'm trying to unwrap the text, then remove the HTML, then re-wrap it so that the text displays properly. Cedric ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230800 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=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Strip ascii 128 and above
Is there a simple way to strip out all characters above ascii 127 from a string? Thanks, Kevin Bridges ~| 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:217743 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
Re: Strip ascii 128 and above
Ok I answered my own question: for (i = 128; i LTE 159; i = i + 1) text = Replace(text, Chr(i), , All); Kevin Bridges wrote: Is there a simple way to strip out all characters above ascii 127 from a string? ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:217745 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
RE: Strip ascii 128 and above
LOCAL.NewText.Append(o) / /cfcase cfcase value=248 cfset LOCAL.NewText.Append(o) / /cfcase cfcase value=249 cfset LOCAL.NewText.Append(u) / /cfcase cfcase value=250 cfset LOCAL.NewText.Append(u) / /cfcase cfcase value=251 cfset LOCAL.NewText.Append(u) / /cfcase cfcase value=252 cfset LOCAL.NewText.Append(u) / /cfcase cfcase value=253 cfset LOCAL.NewText.Append(y) / /cfcase cfcase value=255 cfset LOCAL.NewText.Append(y) / /cfcase /cfswitch cfelse !--- This is a standard company --- cfset LOCAL.NewText.Append(LOCAL.Character) / /cfif /cfloop !--- Return the equivalent value --- cfreturn LOCAL.NewText.ToString() / /cffunction Hope that helps -ben nadel -Original Message- From: Kevin Bridges [mailto:[EMAIL PROTECTED] Sent: Friday, September 09, 2005 9:44 AM To: CF-Talk Subject: Re: Strip ascii 128 and above Ok I answered my own question: for (i = 128; i LTE 159; i = i + 1) text = Replace(text, Chr(i), , All); Kevin Bridges wrote: Is there a simple way to strip out all characters above ascii 127 from a string? ~| 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:217848 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