RE: Regex help maybe
Thanks to everyone. I managed to come up with one similar to Byron's example and then tweaked it further (No spaces) so I could use it in JS on the client and CF on the server. I knew I could do it in 2 or three steps but wanted one step so I could hand off the regex to the client for validation. Dennis Powers UXB Internet - A website Design and Hosting Company P.O. Box 6028, Wolcott, CT 06716 - T:203-879-2844 W: http://www.uxbinternet.com W: http://www.ctbusinesslist.com So like this in the second variant: ^(?=.*\d.*\d.*\d)(?=.*[\~\!\@\#\$\%\^\\*\(\)\_\+]+)[\d\~\!\@\#\$\%\^\\*\(\ )\_\+]{10,20}$ ~| 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:358980 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex help maybe
Can't really help you with the regex, but regexlib.com might help you with future ones. I use it whenever I need a regular expressions -Original Message- From: UXB [mailto:denn...@uxbinternet.com] Sent: Monday, July 21, 2014 6:30 PM To: cf-talk Subject: Regex help maybe I am terrible at Regex's. I looked all over and am going blind. Is there anyone here that can shorted my search? I need one to test true for: 10 to 20 Characters in length 3 numeric characters in any order 1 special character from basic list ~!@#$%^*()_+ Any help is appreciated. Dennis Powers UXB Internet - A website Design and Hosting Company P.O. Box 6028, Wolcott, CT 06716 - T:203-879-2844 W: http://www.uxbinternet.com W: http://www.ctbusinesslist.com ~| 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:358938 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex help maybe
X{10,20} means that X should exist at least 10 times but no more than 20 times [0-9] means any single number from 0 till 9 [0-9]{3} means any 3 numbers of 0-9 one after the other [~!@#$%^*()_+] means a single character from the set of characters defined between the brackets Now do you want 3 numbers one after the other or that there should be 3 numbers in the string total? Can you send a few example strings or talk about how it will be used? Also, do you want a single regex to do it all or can be it be in 2-3 steps (easiest)? On Mon, Jul 21, 2014 at 5:29 PM, UXB denn...@uxbinternet.com wrote: I am terrible at Regex's. I looked all over and am going blind. Is there anyone here that can shorted my search? I need one to test true for: 10 to 20 Characters in length 3 numeric characters in any order 1 special character from basic list ~!@#$%^*()_+ Any help is appreciated. Dennis Powers UXB Internet - A website Design and Hosting Company P.O. Box 6028, Wolcott, CT 06716 - T:203-879-2844 W: http://www.uxbinternet.com W: http://www.ctbusinesslist.com ~| 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:358940 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex help maybe
I need one to test true for: I doubt you can do this with only one test, but using 3 tests is easy: 10 to 20 Characters in length 3 numeric characters in any order 1 special character from basic list ~!@#$%^*()_+ This should do it: CFSET stringOK = (len(form.text) GTE 20 AND len(form.text) LTE 30 AND arrayLen(ReMatch (\d, form.text)) EQ 3 AND arrayLen(ReMatch ([~!@##$%^*()_+], form.text)) EQ 1) Adjust the logical operator depending what ou need is at least or exactly. ~| 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:358944 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex help maybe
This would do one special, 3 consecutive numbers: ajfds123jdfs# ^(?=.*\d{3})(?=.*[\~\!\@\#\$\%\^\\*\(\)\_\+]+).{10,20}$ This would do one special, 3 numbers any position: a#bcdef2k3#4^ ^(?=.*\d.*\d.*\d)(?=.*[\~\!\@\#\$\%\^\\*\(\)\_\+]+).{10,20}$ And if your restricting to just numbers and the special chars outline, replace the last . in either to this. [\d\~\!\@\#\$\%\^\\*\(\)\_\+] So like this in the second variant: ^(?=.*\d.*\d.*\d)(?=.*[\~\!\@\#\$\%\^\\*\(\)\_\+]+)[\d\~\!\@\#\$\%\^\\*\(\)\_\+]{10,20}$ Plenty of online regex testers as well so you don't have to keep coding it up to tweak. I use this one a bit. http://regexpal.com/ Byron Mann Lead Engineer Architect HostMySite On Mon, Jul 21, 2014 at 5:29 PM, UXB denn...@uxbinternet.com wrote: I am terrible at Regex's. I looked all over and am going blind. Is there anyone here that can shorted my search? I need one to test true for: 10 to 20 Characters in length 3 numeric characters in any order 1 special character from basic list ~!@#$%^*()_+ Any help is appreciated. Dennis Powers UXB Internet - A website Design and Hosting Company P.O. Box 6028, Wolcott, CT 06716 - T:203-879-2844 W: http://www.uxbinternet.com W: http://www.ctbusinesslist.com ~| 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:358953 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex question
On Wed, Jul 17, 2013 at 11:15 AM, Matthew Allen wrote: Is it possible to change the reference-link tag from a reference link tag reference-link id=1 type=reference/ to a superscript as so sup1/sup, basically getting the value of the id attribute of the reference link tag and creating a superscript tag with the value. I'll let someone else help with regex, but my comment from the peanut gallery: This smells like something you may be able to easily do using jQuery and let the client side manage this. -Cameron -- Cameron Childress -- p: 678.637.5072 im: cameroncf facebook http://www.facebook.com/cameroncf | twitterhttp://twitter.com/cameronc | google+ https://profiles.google.com/u/0/117829379451708140985 ~| 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:356216 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex for High Ascii Chars
http://cflib.org/udf/stripExtendedAscii On Wed, Apr 18, 2012 at 01:16, Che Vilnonis ch...@asitv.com wrote: Hello all. I'm dealing with a API where some of the results are populated with certain Ascii characters in order to get higher sorting results. For example, some of the characters I'm finding are: 8635 or 9606 or 9658 or 9668 or 9734 or 9835 Is there a regex that could remove all of these characters at once w/o having to maintain an ever growing list of them? TIA, Che ~| 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:350772 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: RegEx Question
Not only can you do it with jQuery, you /should/ do it with jQuery (or equiv). Regex is not built for HTML parsing, and there are many reasons why it wont work correctly when you try. Rather than worry about numerous edge cases, use a tool designed for the job from the start. ~| 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:344746 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: RegEx Question
Thanks that's brilliant! -Original Message- From: Dominic Watson [mailto:watson.domi...@googlemail.com] Sent: Wednesday, May 18, 2011 5:42 AM To: cf-talk Subject: Re: RegEx Question Here is a very blunt regex that should match the opening tag (does not check for the lack of target=_blank: a.*?href=.*?\.pdf.*? Here's a great site: http://gskinner.com/RegExr/ On 18 May 2011 02:30, Lists li...@commadelimited.com wrote: You could actually do this with jquery quite easily should you want to do it client side. $('a[href*=pdf]').click(function(){ window.open($(this).href); }) On May 17, 2011, at 5:35 PM, Duane Boudreau du...@sandybay.com wrote: Hi All, First time posting in a very long time. I'm stuck on a RegEx problem that I can't wrap my head around. I need to have a block of html and I need to add target=_blank to any hyperlink that has a pdf link in it. Any suggestions? Here is the match string I tried so far but I don't think I'm even close. a\\s[^]*href=['\\\]( (?i:)(?:jpg|gif|doc|pdf)$*) If anyone can point me in the right direction it would be much appreciated. TIA, Duane ~| 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:344675 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: RegEx Question
Here is a very blunt regex that should match the opening tag (does not check for the lack of target=_blank: a.*?href=.*?\.pdf.*? Here's a great site: http://gskinner.com/RegExr/ On 18 May 2011 02:30, Lists li...@commadelimited.com wrote: You could actually do this with jquery quite easily should you want to do it client side. $('a[href*=pdf]').click(function(){ window.open($(this).href); }) On May 17, 2011, at 5:35 PM, Duane Boudreau du...@sandybay.com wrote: Hi All, First time posting in a very long time. I'm stuck on a RegEx problem that I can't wrap my head around. I need to have a block of html and I need to add target=_blank to any hyperlink that has a pdf link in it. Any suggestions? Here is the match string I tried so far but I don't think I'm even close. a\\s[^]*href=['\\\]( (?i:)(?:jpg|gif|doc|pdf)$*) If anyone can point me in the right direction it would be much appreciated. TIA, Duane ~| 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:344611 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: RegEx Question
You could actually do this with jquery quite easily should you want to do it client side. $('a[href*=pdf]').click(function(){ window.open($(this).href); }) On May 17, 2011, at 5:35 PM, Duane Boudreau du...@sandybay.com wrote: Hi All, First time posting in a very long time. I'm stuck on a RegEx problem that I can't wrap my head around. I need to have a block of html and I need to add target=_blank to any hyperlink that has a pdf link in it. Any suggestions? Here is the match string I tried so far but I don't think I'm even close. a\\s[^]*href=['\\\]( (?i:)(?:jpg|gif|doc|pdf)$*) If anyone can point me in the right direction it would be much appreciated. TIA, Duane ~| 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:344609 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Question
Could be as simple as \w{3} Would that do it (searching for 3 consecutive word characters)? -- Charlie Griefer http://charlie.griefer.com I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success. On Thursday, April 28, 2011 at 10:10 AM, Rick Colman wrote: input looks like: (A XXX)(B YYY)(C ZZZ) I need to pull out: XXXYYYZZZ ... Can somebody help? TNX. Rick. ~| 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:344026 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex Question
Perhaps using list functions? cfset myList =(A XXX)(B YYY)(C ZZZ) cfset loop1 = listlen(mylist,)) cfset myresult = cfoutput cfloop from=1 to=#loop1# index=A cfset loopStr1 = listgetat(myList, A, )) cfset myResult = #myresult##right(loopStr1, 3)# /cfloop /cfoutput -Original Message- From: Rick Colman [mailto:rcol...@cox.net] Sent: 28 April 2011 18:10 To: cf-talk Subject: Regex Question input looks like: (A XXX)(B YYY)(C ZZZ) I need to pull out: XXXYYYZZZ ... Can somebody help? TNX. Rick. ~| 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:344027 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Question
That seems like it might do the trick: http://regexr.com?2tl99 Could be as simple as \w{3} Would that do it (searching for 3 consecutive word characters)? -- Charlie Griefer http://charlie.griefer.com I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success. On Thursday, April 28, 2011 at 10:10 AM, Rick Colman wrote: input looks like: (A XXX)(B YYY)(C ZZZ) I need to pull out: XXXYYYZZZ ... Can somebody help? TNX. Rick. ~| 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:344030 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Question
would it ignore the parens and space? will try shortly. TNX! On 4/28/2011 1:17 PM, Andy Matthews wrote: That seems like it might do the trick: http://regexr.com?2tl99 Could be as simple as \w{3} Would that do it (searching for 3 consecutive word characters)? -- Charlie Griefer http://charlie.griefer.com I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success. On Thursday, April 28, 2011 at 10:10 AM, Rick Colman wrote: input looks like: (A XXX)(B YYY)(C ZZZ) I need to pull out: XXXYYYZZZ ... Can somebody help? TNX. Rick. ~| 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:344032 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex help needed
FYI I figure it out was simple once you looked at the content. since it is all in commented tags ReReplaceNoCase(str,!--(.*?)--, , ALL); Just incase anyone else has this issue. I am having an issue creating a regex to strip out the XML content that Word 2007 is adding our HTML editor. we are using TINYMEC and when one of our client upgraded recently it has created a large number of issues. what we need to do is to pull out the flowing content. it starts with !--[if gte mso 9]xmlbr/b w:WordDocumentbr/b Ends with ![endif]-- there is about 1000 chars between the nodes and sometimes there are muliple set of nodes with the same IF and endif I was trying to create a regex to strip out this content - everything from the begining to the end (I want NONE of it). if anyone has any other suggestion we are all ears here. Thanks - I am just not great at this regex stuff and can not get the correct statement. Matt ~| 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:342207 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
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: Regex Question
Robert, How about treating CGI.path_info as a list, using / as your delimiter. Then you can use the various list* functions in CF to parse it however you want. Carl On 12/3/2010 9:26 AM, Robert Harrison wrote: Regex is not my strong suit, but someone may know this off the top of their head. If I have a long url like: http://www.mysite.com/item1/option2/part3/section4 I can use cgi.path_info to get the /item1/option2/part3/section4 part of the string. Now is there an easy regex that could let me get the item1 option2 part3 section4 parts of the string easily? I'd assume there could just be one regex statement where you could just change the number(s) to get data from first / to second /; data from second / to third /, etc. Any ideas? Thanks Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be. Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged ~| 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:339757 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Question
Agreed. /item1/option2/part3/section4 cfoutput item = #listFirst(cgi.path_info, /)# br / option = #listGetAt(cgi.path_info, 2, /)# br / part = #listGetAt(cgi.path_info, 3, /)# br / section = #listLast(cgi.path_info, /)# /cfoutput From: Carl Von Stetten vonner.li...@vonner.net Sent: Friday, December 03, 2010 12:36 PM To: cf-talk cf-talk@houseoffusion.com Subject: Re: Regex Question Robert, How about treating CGI.path_info as a list, using / as your delimiter. Then you can use the various list* functions in CF to parse it however you want. Carl On 12/3/2010 9:26 AM, Robert Harrison wrote: Regex is not my strong suit, but someone may know this off the top of their head. If I have a long url like: http://www.mysite.com/item1/option2/part3/section4 I can use cgi.path_info to get the /item1/option2/part3/section4 part of the string. Now is there an easy regex that could let me get the item1 option2 part3 section4 parts of the string easily? I'd assume there could just be one regex statement where you could just change the number(s) to get data from first / to second /; data from second / to third /, etc. Any ideas? Thanks Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be. Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged ~| 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:339760 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex Question
listGetAt(cgi.path_info, 2, /) Great. That will work for what I want. I want to be able to pass the cgi.path_info to a CFC and pass a digit so the CFC could extract the part of the string I want to do a query... I'm using long URLs to pass variables more and more these days, as opposed to ?bin=1item=2part=3. Thanks Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged ~| 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:339761 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex Question
Yep, that'll work. Of course, listGetAt(cgi.path_info, 1, /) is the same as listFirst(cgi.path_info, /), so just passing the integer is a nice solution: returnVar = listGetAt(arguments.path_info, arguments.index, /); From: Robert Harrison rob...@austin-williams.com Sent: Friday, December 03, 2010 1:03 PM To: cf-talk cf-talk@houseoffusion.com Subject: RE: Regex Question listGetAt(cgi.path_info, 2, /) Great. That will work for what I want. I want to be able to pass the cgi.path_info to a CFC and pass a digit so the CFC could extract the part of the string I want to do a query... I'm using long URLs to pass variables more and more these days, as opposed to ?bin=1item=2part=3. Thanks Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged ~| 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:339762 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: REGEX hell
Regex that is useful but unfortunately, my skills are pretty weak in that area. I use an application named The Regex Coach' to build my code. It has a place to put the string you are trying to match and another place to put your regex code. As you modify the regex code, it highlights how much of the string matches. The program is free with the option of donating via paypal to the creator if you like it. J - No man's life, liberty, or property is safe while the legislature is in session. - Mark Twain ~| 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:339530 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: REGEX hell
Be a little careful, Regex Coach works with perl regex syntax; cf needs java syntax usually, with some differences. I can't recommend Regex Buddy highly enough. It's not free, but it's really quite excellent, supports a variety of different flavors. Dave On Thu, Nov 25, 2010 at 10:17 AM, Jerry Barnes critic...@gmail.com wrote: Regex that is useful but unfortunately, my skills are pretty weak in that area. I use an application named The Regex Coach' to build my code. It has a place to put the string you are trying to match and another place to put your regex code. As you modify the regex code, it highlights how much of the string matches. The program is free with the option of donating via paypal to the creator if you like it. J - No man's life, liberty, or property is safe while the legislature is in session. - Mark Twain ~| 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:339532 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: REGEX hell
... since we're throwing out recommendations for our favorite so glad this exists because of how badly I suck at reg ex apps, I've found http://gskinner.com/RegExr/desktop/ to be a -very- valuable tool. On Thu, Nov 25, 2010 at 8:56 AM, Dave Merrill enigm...@gmail.com wrote: Be a little careful, Regex Coach works with perl regex syntax; cf needs java syntax usually, with some differences. I can't recommend Regex Buddy highly enough. It's not free, but it's really quite excellent, supports a variety of different flavors. Dave On Thu, Nov 25, 2010 at 10:17 AM, Jerry Barnes critic...@gmail.com wrote: Regex that is useful but unfortunately, my skills are pretty weak in that area. I use an application named The Regex Coach' to build my code. It has a place to put the string you are trying to match and another place to put your regex code. As you modify the regex code, it highlights how much of the string matches. The program is free with the option of donating via paypal to the creator if you like it. J - No man's life, liberty, or property is safe while the legislature is in session. - Mark Twain ~| 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:339533 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: REGEX hell
In this situation, there is no real difference between lazy or greedy - because the quantified item is mutually exclusive with the next characters - i.e. \s+ cannot match \) - so it will always consume to the end of the whitespace. It is better to not assume lazy or greedy as a 'default' and always decide which one makes sense for the current scenario. ~| 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:339535 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: REGEX hell
To be clear, CF uses the Apache ORO library, which is different to both Perl and Java Regex. ~| 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:339536 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: REGEX hell
On Thu, Nov 25, 2010 at 10:48 AM, Peter Boughton wrote: To be clear, CF uses the Apache ORO library, which is different to both Perl and Java Regex. I've found the QuickREx Eclipse plugin *invaluable* for regular expression work. It supports several different regex engines, has libraries of regexes... It's fantastic! :Den -- The most important part of education is proper training in the nursery. Plato ~| 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:339537 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: REGEX hell
no need to escape the space char with a slash. are you sure it is only 1 space, and are you sure it is a space char (chr(32))? If so, remove the slash in front of the space, and it should work. also, pet peeve, no need for the ## around the function. Works either way, though, so ignore if you prefer. Jerry Milo Johnson On Mon, Nov 22, 2010 at 8:48 PM, Rick Colman rcol...@cox.net wrote: I am trying to replace two trailing parens )) with a single paren. here is a sample string: (K AAA) (N AAC) (E GAA) ) looks like there is a space in between the two )), so I tried: cfset cleandata2 = #REReplaceNoCase( cleandata1,'\)\ \)',')','all')# but this is not working. Any ideas as two what is wrong greatly appreciated. ~| 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:339442 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: REGEX hell
Are you sure it's a space and not 2 spaces? Or a tab? Try using \s* to indicate that there may be one or more space characters. \)\s*\) cfset cleandata2 = REReplaceNoCase(cleandata1, '\)\s*\)', ')', 'all') On Mon, Nov 22, 2010 at 8:48 PM, Rick Colman rcol...@cox.net wrote: I am trying to replace two trailing parens )) with a single paren. here is a sample string: (K AAA) (N AAC) (E GAA) ) looks like there is a space in between the two )), so I tried: cfset cleandata2 = #REReplaceNoCase( cleandata1,'\)\ \)',')','all')# but this is not working. Any ideas as two what is wrong greatly appreciated. ~| 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:339443 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: REGEX hell
This worked!! TNX. On 11/22/2010 6:04 PM, Michael Dinowitz wrote: Are you sure it's a space and not 2 spaces? Or a tab? Try using \s* to indicate that there may be one or more space characters. \)\s*\) cfset cleandata2 = REReplaceNoCase(cleandata1, '\)\s*\)', ')', 'all') On Mon, Nov 22, 2010 at 8:48 PM, Rick Colmanrcol...@cox.net wrote: I am trying to replace two trailing parens )) with a single paren. here is a sample string: (K AAA) (N AAC) (E GAA) ) looks like there is a space in between the two )), so I tried: cfset cleandata2 = #REReplaceNoCase( cleandata1,'\)\ \)',')','all')# but this is not working. Any ideas as two what is wrong greatly appreciated. ~| 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:339444 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: REGEX hell
For future reference you should avoid using * where possible as it can easily lead to overmatching. Even using + would be better although both + and * alone are greedy matches. An even better solution would be to use a lazy match like so: \)\s+?\) The ? following the + tells the regex engine to match as little as possible. andy -Original Message- From: Rick Colman [mailto:rcol...@cox.net] Sent: Monday, November 22, 2010 9:59 PM To: cf-talk Subject: Re: REGEX hell This worked!! TNX. On 11/22/2010 6:04 PM, Michael Dinowitz wrote: Are you sure it's a space and not 2 spaces? Or a tab? Try using \s* to indicate that there may be one or more space characters. \)\s*\) cfset cleandata2 = REReplaceNoCase(cleandata1, '\)\s*\)', ')', 'all') On Mon, Nov 22, 2010 at 8:48 PM, Rick Colmanrcol...@cox.net wrote: I am trying to replace two trailing parens )) with a single paren. here is a sample string: (K AAA) (N AAC) (E GAA) ) looks like there is a space in between the two )), so I tried: cfset cleandata2 = #REReplaceNoCase( cleandata1,'\)\ \)',')','all')# but this is not working. Any ideas as two what is wrong greatly appreciated. ~| 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:339445 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: REGEX hell
I agree that the * (0 or more) should be avoided unless needed but in this case I felt it was. There may or may not be a space. There may be more than one space. There may be a space character being seen as a space (like a tab). Because we don't know if a space will actually exist, the * is needed. The +? (1 or more but as few as needed) assumes that at least one space exists. As a rule I don't over-worry about using * when it's used with a \s (space) unless I really have to. On Tue, Nov 23, 2010 at 12:20 AM, andy matthews li...@commadelimited.comwrote: For future reference you should avoid using * where possible as it can easily lead to overmatching. Even using + would be better although both + and * alone are greedy matches. An even better solution would be to use a lazy match like so: \)\s+?\) The ? following the + tells the regex engine to match as little as possible. andy -Original Message- From: Rick Colman [mailto:rcol...@cox.net] Sent: Monday, November 22, 2010 9:59 PM To: cf-talk Subject: Re: REGEX hell This worked!! TNX. On 11/22/2010 6:04 PM, Michael Dinowitz wrote: Are you sure it's a space and not 2 spaces? Or a tab? Try using \s* to indicate that there may be one or more space characters. \)\s*\) cfset cleandata2 = REReplaceNoCase(cleandata1, '\)\s*\)', ')', 'all') On Mon, Nov 22, 2010 at 8:48 PM, Rick Colmanrcol...@cox.net wrote: I am trying to replace two trailing parens )) with a single paren. here is a sample string: (K AAA) (N AAC) (E GAA) ) looks like there is a space in between the two )), so I tried: cfset cleandata2 = #REReplaceNoCase( cleandata1,'\)\ \)',')','all')# but this is not working. Any ideas as two what is wrong greatly appreciated. ~| 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:339446 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex to parse cfhttp.filecontent?
http://regexr.com?2sg59 In CF, that would return an array with one or more matches. You could then just remove the part you don't want, namely AUTHORIZATION RESULT: , and proceed with your string. andy -Original Message- From: Marie Taylore [mailto:mt4yl...@yahoo.com] Sent: Thursday, November 04, 2010 6:51 PM To: cf-talk Subject: Regex to parse cfhttp.filecontent? Hi all, I need help in parsing returned cfhttp.filecontent contents. I need to find the line with AUTHORIZATION RESULT: and then get all the text that follows on that same line. I'm sure there's a simple way to do that with ReFind, but I'm a Regex idiot. Any help would be appreciated. Thanks! MarieT ~| 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:338837 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: RegEx: Grabbing Keywords from Referers
cfset keywords = reMatchNoCase([?|][p|q]=[^]+, referer) This is incorrect - the | is a literal in character classes. You want [?][pq]=[^]+ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336489 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: RegEx: Grabbing Keywords from Referers
Thanks for the update Peter. -Original Message- From: Peter Boughton [mailto:bought...@gmail.com] Sent: Tuesday, August 24, 2010 4:58 AM To: cf-talk Subject: Re: RegEx: Grabbing Keywords from Referers cfset keywords = reMatchNoCase([?|][p|q]=[^]+, referer) This is incorrect - the | is a literal in character classes. You want [?][pq]=[^]+ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336491 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: RegEx: Grabbing Keywords from Referers
Nice solution John. Thanks! Definitely different than mine. I wonder if the regex gurus have a solution as well. ;) -Original Message- From: John M Bliss [mailto:bliss.j...@gmail.com] Sent: Monday, August 23, 2010 1:00 PM To: cf-talk Subject: Re: Grabbing Keywords from Referers This does (at least) Google. Shouldn't be too difficult to extrapolate the others... cfloop index=thisarg list=#cgi.HTTP_REFERER# delimiters=? cfif ListFirst(thisarg, =) is q and ListLen(thisarg, =) is 2 !--- then user searched for URLDecode(ListLast(thisarg, '=')) --- cfbreak /cfif /cfloop On Mon, Aug 23, 2010 at 11:52 AM, Che Vilnonis ch...@asitv.com wrote: I'm looking for a script to parse (yahoo,bing,google) keywords from the cgi.http_referer variable preferrably done using CF's or a Java RegEx. Is there such a beast? TIA, Che ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336472 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: RegEx: Grabbing Keywords from Referers
I wonder if the regex gurus have a solution as well. Oh, I'm sure. :-) On Mon, Aug 23, 2010 at 12:54 PM, Che Vilnonis ch...@asitv.com wrote: Nice solution John. Thanks! Definitely different than mine. I wonder if the regex gurus have a solution as well. ;) -Original Message- From: John M Bliss [mailto:bliss.j...@gmail.com] Sent: Monday, August 23, 2010 1:00 PM To: cf-talk Subject: Re: Grabbing Keywords from Referers This does (at least) Google. Shouldn't be too difficult to extrapolate the others... cfloop index=thisarg list=#cgi.HTTP_REFERER# delimiters=? cfif ListFirst(thisarg, =) is q and ListLen(thisarg, =) is 2 !--- then user searched for URLDecode(ListLast(thisarg, '=')) --- cfbreak /cfif /cfloop On Mon, Aug 23, 2010 at 11:52 AM, Che Vilnonis ch...@asitv.com wrote: I'm looking for a script to parse (yahoo,bing,google) keywords from the cgi.http_referer variable preferrably done using CF's or a Java RegEx. Is there such a beast? TIA, Che ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336473 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: RegEx: Grabbing Keywords from Referers
This regex would search through a string and return all occurences of q=followed by any character that's NOT an . q=[^]+ Given this string: http://www.google.com/search?source=ighl=enrlz=q=coldfusionaq=faqi=g-p3 g7aql=oq=gs_rfai=CJtNhsL9yTK_zHIWWhgTb-J3tDwAAAKoEBU_QXcSj It matches q=coldfusion q=f Not sure where the second q= came from. I just did a search on the Google homepage for ColdFusion. andy -Original Message- From: Che Vilnonis [mailto:ch...@asitv.com] Sent: Monday, August 23, 2010 12:54 PM To: cf-talk Subject: RE: RegEx: Grabbing Keywords from Referers Nice solution John. Thanks! Definitely different than mine. I wonder if the regex gurus have a solution as well. ;) -Original Message- From: John M Bliss [mailto:bliss.j...@gmail.com] Sent: Monday, August 23, 2010 1:00 PM To: cf-talk Subject: Re: Grabbing Keywords from Referers This does (at least) Google. Shouldn't be too difficult to extrapolate the others... cfloop index=thisarg list=#cgi.HTTP_REFERER# delimiters=? cfif ListFirst(thisarg, =) is q and ListLen(thisarg, =) is 2 !--- then user searched for URLDecode(ListLast(thisarg, '=')) --- cfbreak /cfif /cfloop ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336474 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: RegEx: Grabbing Keywords from Referers
Not sure where the second q= came from. From this: aq=f On Mon, Aug 23, 2010 at 1:44 PM, Andy Matthews li...@commadelimited.comwrote: This regex would search through a string and return all occurences of q=followed by any character that's NOT an . q=[^]+ Given this string: http://www.google.com/search?source=ighl=enrlz=q=coldfusionaq=faqi=g-p3 g7aql=oq=gs_rfai=CJtNhsL9yTK_zHIWWhgTb-J3tDwAAAKoEBU_QXcSj It matches q=coldfusion q=f Not sure where the second q= came from. I just did a search on the Google homepage for ColdFusion. andy -Original Message- From: Che Vilnonis [mailto:ch...@asitv.com] Sent: Monday, August 23, 2010 12:54 PM To: cf-talk Subject: RE: RegEx: Grabbing Keywords from Referers Nice solution John. Thanks! Definitely different than mine. I wonder if the regex gurus have a solution as well. ;) -Original Message- From: John M Bliss [mailto:bliss.j...@gmail.com] Sent: Monday, August 23, 2010 1:00 PM To: cf-talk Subject: Re: Grabbing Keywords from Referers This does (at least) Google. Shouldn't be too difficult to extrapolate the others... cfloop index=thisarg list=#cgi.HTTP_REFERER# delimiters=? cfif ListFirst(thisarg, =) is q and ListLen(thisarg, =) is 2 !--- then user searched for URLDecode(ListLast(thisarg, '=')) --- cfbreak /cfif /cfloop ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336475 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: RegEx: Grabbing Keywords from Referers
Ah. The text was so small in my testing app that I couldn't tell what that was. Try this instead: [?|]q=[^]+ That only looks for q= when immediately following a ? or an . Given the same string: http://www.google.com/search?q=coldfusionsource=ighl=enrlz=aq=faqi=g-p3 g7aql=oq=gs_rfai=CJtNhsL9yTK_zHIWWhgTb-J3tDwAAAKoEBU_QXcSj It only matches ?q=coldfusion or q=coldfusion -Original Message- From: John M Bliss [mailto:bliss.j...@gmail.com] Sent: Monday, August 23, 2010 1:48 PM To: cf-talk Subject: Re: RegEx: Grabbing Keywords from Referers Not sure where the second q= came from. From this: aq=f On Mon, Aug 23, 2010 at 1:44 PM, Andy Matthews li...@commadelimited.comwrote: This regex would search through a string and return all occurences of q=followed by any character that's NOT an . q=[^]+ Given this string: http://www.google.com/search?source=ighl=enrlz=q=coldfusionaq=faq i=g-p3 g7aql=oq=gs_rfai=CJtNhsL9yTK_zHIWWhgTb-J3tDwAAAKoEBU_QXcSj It matches q=coldfusion q=f Not sure where the second q= came from. I just did a search on the Google homepage for ColdFusion. andy -Original Message- From: Che Vilnonis [mailto:ch...@asitv.com] Sent: Monday, August 23, 2010 12:54 PM To: cf-talk Subject: RE: RegEx: Grabbing Keywords from Referers Nice solution John. Thanks! Definitely different than mine. I wonder if the regex gurus have a solution as well. ;) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336476 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: RegEx: Grabbing Keywords from Referers
Wow. That works very well. Thanks! -Original Message- From: Andy Matthews [mailto:li...@commadelimited.com] Sent: Monday, August 23, 2010 2:55 PM To: cf-talk Subject: RE: RegEx: Grabbing Keywords from Referers Ah. The text was so small in my testing app that I couldn't tell what that was. Try this instead: [?|]q=[^]+ That only looks for q= when immediately following a ? or an . Given the same string: http://www.google.com/search?q=coldfusionsource=ighl=enrlz=aq=faqi=g-p3 g7aql=oq=gs_rfai=CJtNhsL9yTK_zHIWWhgTb-J3tDwAAAKoEBU_QXcSj It only matches ?q=coldfusion or q=coldfusion -Original Message- From: John M Bliss [mailto:bliss.j...@gmail.com] Sent: Monday, August 23, 2010 1:48 PM To: cf-talk Subject: Re: RegEx: Grabbing Keywords from Referers Not sure where the second q= came from. From this: aq=f On Mon, Aug 23, 2010 at 1:44 PM, Andy Matthews li...@commadelimited.comwrote: This regex would search through a string and return all occurences of q=followed by any character that's NOT an . q=[^]+ Given this string: http://www.google.com/search?source=ighl=enrlz=q=coldfusionaq=faq i=g-p3 g7aql=oq=gs_rfai=CJtNhsL9yTK_zHIWWhgTb-J3tDwAAAKoEBU_QXcSj It matches q=coldfusion q=f Not sure where the second q= came from. I just did a search on the Google homepage for ColdFusion. andy -Original Message- From: Che Vilnonis [mailto:ch...@asitv.com] Sent: Monday, August 23, 2010 12:54 PM To: cf-talk Subject: RE: RegEx: Grabbing Keywords from Referers Nice solution John. Thanks! Definitely different than mine. I wonder if the regex gurus have a solution as well. ;) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336480 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: RegEx: Grabbing Keywords from Referers
Andy thanks again so much... this seems to work with Yahoo,Bing Google. My RegEx skills are a work in progress. cfset referer = http://search.yahoo.com/search;_ylt=Aqj24Omsi1LGKlDY4_G1hi6bvZx4?fr=yfp-t-7 01-stoggle=1cop=mssei=UTF8p=children%20karate%20uniform cfset keywords = reMatchNoCase([?|][p|q]=[^]+, referer) cfset keywords = urlDecode(reReplace(keywords[1],[?|][p|q]=, ,ALL)) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336481 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: RegEx: Grabbing Keywords from Referers
Awesome Che! Glad I could be of help! andy -Original Message- From: Che Vilnonis [mailto:ch...@asitv.com] Sent: Monday, August 23, 2010 3:01 PM To: cf-talk Subject: RE: RegEx: Grabbing Keywords from Referers Andy thanks again so much... this seems to work with Yahoo,Bing Google. My RegEx skills are a work in progress. cfset referer = http://search.yahoo.com/search;_ylt=Aqj24Omsi1LGKlDY4_G1hi6bvZx4?fr=yfp-t-7 01-stoggle=1cop=mssei=UTF8p=children%20karate%20uniform cfset keywords = reMatchNoCase([?|][p|q]=[^]+, referer) cfset keywords = urlDecode(reReplace(keywords[1],[?|][p|q]=, ,ALL)) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336482 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex question
On 8/19/2010 8:32 AM, Ian Skinner wrote: I need to turn some relative links into absolute links in a string. I have this rereplace() working well to do that. rereplace(links,'(href=)([^]*)','\1http://www.cdpr.ca.gov\2','ALL') Thank you Ian, adding the forward slash[/] character in two places solved this nicely! rereplace(links,'(href=)/([^]*)','\1http://www.cdpr.ca.gov/\2','ALL') ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336417 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Help
I hope he does because your post literally made me laugh out loud. On Mon, Jul 26, 2010 at 8:52 PM, andy matthews li...@commadelimited.comwrote: You know I was kidding right? -Original Message- From: Bobby Hartsfield [mailto:bo...@acoderslife.com] Sent: Monday, July 26, 2010 6:21 PM To: cf-talk Subject: RE: Regex Help Sigh... .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Andy Matthews [mailto:li...@commadelimited.com] Sent: Monday, July 26, 2010 3:03 PM To: cf-talk Subject: RE: Regex Help [Completely irrelevant link removed] :) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335748 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex Help
I knew you were kidding, but I don't have time to laugh. I converting all my URLs from the old variable scheme (i.e., news.cfm?id=7) to the stupid SEO spoonfeed urls (i.e., news.cfm/this-is-my-article-for-stupid-lazy-google-programmers-who-cant-unde rstand-variables). I hate this. I now believe Google has supplanted Microsoft as the most evil entity on the planet. Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Monday, July 26, 2010 9:15 PM To: cf-talk Subject: Re: Regex Help I hope he does because your post literally made me laugh out loud. On Mon, Jul 26, 2010 at 8:52 PM, andy matthews li...@commadelimited.comwrote: You know I was kidding right? -Original Message- From: Bobby Hartsfield [mailto:bo...@acoderslife.com] Sent: Monday, July 26, 2010 6:21 PM To: cf-talk Subject: RE: Regex Help Sigh... .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Andy Matthews [mailto:li...@commadelimited.com] Sent: Monday, July 26, 2010 3:03 PM To: cf-talk Subject: RE: Regex Help [Completely irrelevant link removed] :) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335749 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Help
Why not use url rewrite instead? This type of thing is perfect for it, plus none of your existing links will break. On Tue, Jul 27, 2010 at 10:55 AM, Robert Harrison rob...@austin-williams.com wrote: I knew you were kidding, but I don't have time to laugh. I converting all my URLs from the old variable scheme (i.e., news.cfm?id=7) to the stupid SEO spoonfeed urls (i.e., news.cfm/this-is-my-article-for-stupid-lazy-google-programmers-who-cant-unde rstand-variables). I hate this. I now believe Google has supplanted Microsoft as the most evil entity on the planet. Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Monday, July 26, 2010 9:15 PM To: cf-talk Subject: Re: Regex Help I hope he does because your post literally made me laugh out loud. On Mon, Jul 26, 2010 at 8:52 PM, andy matthews li...@commadelimited.comwrote: You know I was kidding right? -Original Message- From: Bobby Hartsfield [mailto:bo...@acoderslife.com] Sent: Monday, July 26, 2010 6:21 PM To: cf-talk Subject: RE: Regex Help Sigh... .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Andy Matthews [mailto:li...@commadelimited.com] Sent: Monday, July 26, 2010 3:03 PM To: cf-talk Subject: RE: Regex Help [Completely irrelevant link removed] :) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335750 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex Help
Why not use url rewrite instead? What's that? Have a link? Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged __ Information from ESET Smart Security, version of virus signature database 5317 (20100727) __ The message was checked by ESET Smart Security. http://www.eset.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335751 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Help
http://en.wikipedia.org/wiki/Rewrite_engine On Tue, Jul 27, 2010 at 11:17 AM, Robert Harrison rob...@austin-williams.com wrote: Why not use url rewrite instead? What's that? Have a link? Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged __ Information from ESET Smart Security, version of virus signature database 5317 (20100727) __ The message was checked by ESET Smart Security. http://www.eset.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335752 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex Help
Why not use url rewrite instead? If it's this: http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/ that looks good but it also requires server IIS intervention. That does not solve the problem on all my sites and all the servers they are running on. Building them into my own CMS permanently solves the problem and keeps my tools portable for various server environments. In the long run it's I'm thinking it's probably best to make my CMS tools just work that way so I'm not thwarted by an uncooperative host. Does that make since? Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged -Original Message- From: Robert Harrison [mailto:rob...@austin-williams.com] Sent: Tuesday, July 27, 2010 11:17 AM To: cf-talk Subject: RE: Regex Help Why not use url rewrite instead? What's that? Have a link? Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged __ Information from ESET Smart Security, version of virus signature database 5317 (20100727) __ The message was checked by ESET Smart Security. http://www.eset.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335753 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex Help
He'd still want to change all of his existing URLs so that they're correct moving forward. However, you're right, he could use ISAPI Rewrite (IIS) or mod_rewrite (Apache) and let the web server take care of it andy -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Tuesday, July 27, 2010 10:05 AM To: cf-talk Subject: Re: Regex Help Why not use url rewrite instead? This type of thing is perfect for it, plus none of your existing links will break. On Tue, Jul 27, 2010 at 10:55 AM, Robert Harrison rob...@austin-williams.com wrote: I knew you were kidding, but I don't have time to laugh. I converting all my URLs from the old variable scheme (i.e., news.cfm?id=7) to the stupid SEO spoonfeed urls (i.e., news.cfm/this-is-my-article-for-stupid-lazy-google-programmers-who-can t-unde rstand-variables). I hate this. I now believe Google has supplanted Microsoft as the most evil entity on the planet. Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Monday, July 26, 2010 9:15 PM To: cf-talk Subject: Re: Regex Help I hope he does because your post literally made me laugh out loud. On Mon, Jul 26, 2010 at 8:52 PM, andy matthews li...@commadelimited.comwrote: You know I was kidding right? -Original Message- From: Bobby Hartsfield [mailto:bo...@acoderslife.com] Sent: Monday, July 26, 2010 6:21 PM To: cf-talk Subject: RE: Regex Help Sigh... .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Andy Matthews [mailto:li...@commadelimited.com] Sent: Monday, July 26, 2010 3:03 PM To: cf-talk Subject: RE: Regex Help [Completely irrelevant link removed] :) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335754 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex Help
Fixing the current links within your site so that they're search engine safe will actually break ALL of your indexed links within Google, or Yahoo, etc. Having a URL rewrite in place alongside your code changes will allow Google to keep your links indexed and update them the next time it indexes your site. My host uses ISAPI_REWRITE for IIS and here's what my .htaccess file looks like for my blog: RewriteEngine on RewriteRule category/([a-zA-Z0-9-]+) index.cfm?verb=categoryterm=$1 RewriteRule search/([a-zA-Z0-9-,]+) index.cfm?verb=searchterm=$1 RewriteRule rss/([a-zA-Z0-9-,]+)? rss.cfm?feed=$1 I personally HATE having to have the index.cfm in my links so I wrote this to keep me from having to do that. A category link might look like this: http://andymatthews.net/category/jQuery/ What the regex does in the second line above is to capture (regex) everything after category/ and pass it to index.cfm as verb=categoryterm=jQuery andy -Original Message- From: Robert Harrison [mailto:rob...@austin-williams.com] Sent: Tuesday, July 27, 2010 10:24 AM To: cf-talk Subject: RE: Regex Help Why not use url rewrite instead? If it's this: http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/ that looks good but it also requires server IIS intervention. That does not solve the problem on all my sites and all the servers they are running on. Building them into my own CMS permanently solves the problem and keeps my tools portable for various server environments. In the long run it's I'm thinking it's probably best to make my CMS tools just work that way so I'm not thwarted by an uncooperative host. Does that make since? Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged -Original Message- From: Robert Harrison [mailto:rob...@austin-williams.com] Sent: Tuesday, July 27, 2010 11:17 AM To: cf-talk Subject: RE: Regex Help Why not use url rewrite instead? What's that? Have a link? Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged __ Information from ESET Smart Security, version of virus signature database 5317 (20100727) __ The message was checked by ESET Smart Security. http://www.eset.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335755 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Help
I converting all my URLs from the old variable scheme (i.e., news.cfm?id=7) to the stupid SEO spoonfeed urls (i.e., news.cfm/this-is-my-article-for-stupid-lazy-google-programmers-who-cant-unde rstand-variables). I hate this. I now believe Google has supplanted Microsoft as the most evil entity on the planet. Well, that's kind of dumb. Google didn't come out to your office and make you rewrite your URLs, did they? You can certainly use embedded URL parameters, and Google will still index your pages. But Google, like regular people, can make more sense out of URLs that themselves make more sense. This has nothing to do with laziness, and everything to do with how URLs are meant to be used: http://www.w3.org/Provider/Style/URI In general, when it comes to SEO, common sense is your best guide. And there's a good argument to be made that implementation details should be minimized or removed entirely from URLs. Why not use url rewrite instead? If it's this: http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/ that looks good but it also requires server IIS intervention. That does not solve the problem on all my sites and all the servers they are running on. Building them into my own CMS permanently solves the problem and keeps my tools portable for various server environments. In the long run it's I'm thinking it's probably best to make my CMS tools just work that way so I'm not thwarted by an uncooperative host. Then you should be looking at this: http://www.tuckey.org/urlrewrite/ Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335757 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex Help
Fixing the current links within your site so that they're search engine safe will actually break ALL of your indexed links within Google, or Yahoo, etc. In this case I put in a hook old so the old links still work. They do a 301 redirect to the new link schema. That should cover the search engines and any bookmarks. It seems to be working... http://www.austin-williams.com/news.cfm. All the links are now SEO 'friendly'. I've set it up so the CMS automatically builds the link when new records are added. Most of the time there is no need to change that, but I've also put in an option to 'rebuild' a link on record update. It defaults to OFF, but it can be forced on to do it sometimes. Here's a case in point why I did that... One thing we build is banking sites. So they create an account and it builds the link: http://commercialbank.com/accounts/free-checking. That's great, but now the CEO they can't afford to give away checking accounts anymore, so they need to charge $2/month. So the update the account, but http://commercialbank.com/accounts/free-checking is misleading. In this case they need to change the link, so they have an option to rebuild to, say: http://commercialbank.com/accounts/really-cheap-checking. I see no way around this. In spite of the best efforts, some links may occasionally be lost. Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged __ Information from ESET Smart Security, version of virus signature database 5317 (20100727) __ The message was checked by ESET Smart Security. http://www.eset.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335761 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Help
Robert: Decided I'd check out your site. This page is messed up: http://www.austin-williams.com/people/ Barbara Espisito's mini bio is all screwy. (Ironic that she's the copy chief.) Looking at the source it looks like your db entry for her is mangled pretty badly. On another note, who took those pictures? Was it their intent to catch everyone in the middle of an awkward expression? On Tue, Jul 27, 2010 at 12:11 PM, Robert Harrison rob...@austin-williams.com wrote: Fixing the current links within your site so that they're search engine safe will actually break ALL of your indexed links within Google, or Yahoo, etc. In this case I put in a hook old so the old links still work. They do a 301 redirect to the new link schema. That should cover the search engines and any bookmarks. It seems to be working... http://www.austin-williams.com/news.cfm. All the links are now SEO 'friendly'. I've set it up so the CMS automatically builds the link when new records are added. Most of the time there is no need to change that, but I've also put in an option to 'rebuild' a link on record update. It defaults to OFF, but it can be forced on to do it sometimes. Here's a case in point why I did that... One thing we build is banking sites. So they create an account and it builds the link: http://commercialbank.com/accounts/free-checking. That's great, but now the CEO they can't afford to give away checking accounts anymore, so they need to charge $2/month. So the update the account, but http://commercialbank.com/accounts/free-checking is misleading. In this case they need to change the link, so they have an option to rebuild to, say: http://commercialbank.com/accounts/really-cheap-checking. I see no way around this. In spite of the best efforts, some links may occasionally be lost. Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged __ Information from ESET Smart Security, version of virus signature database 5317 (20100727) __ The message was checked by ESET Smart Security. http://www.eset.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335762 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex Help
Absolutely... nd I thought it was pretty funny :-) .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: andy matthews [mailto:li...@commadelimited.com] Sent: Monday, July 26, 2010 8:52 PM To: cf-talk Subject: RE: Regex Help You know I was kidding right? -Original Message- From: Bobby Hartsfield [mailto:bo...@acoderslife.com] Sent: Monday, July 26, 2010 6:21 PM To: cf-talk Subject: RE: Regex Help Sigh... .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Andy Matthews [mailto:li...@commadelimited.com] Sent: Monday, July 26, 2010 3:03 PM To: cf-talk Subject: RE: Regex Help [Completely irrelevant link removed] :) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335763 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex Help
Hmmm. Those pages are static and http://www.austin-williams.com/people/barbara-esposito.cfm looks fine from here. What are you seeing? What browser are you on? As far as the pictures, I'm the Technology Director, not the Creative Director. That is ground on which I do not tread :-) Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged __ Information from ESET Smart Security, version of virus signature database 5318 (20100727) __ The message was checked by ESET Smart Security. http://www.eset.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335764 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Help
It was on the link I posted. However after going to it again I see it's not outputting the same as it was. Weird. I'm on chrome. Her text description was displaying hundreds of little rectangles. Like when character encoding is improper. On Tue, Jul 27, 2010 at 12:28 PM, Robert Harrison rob...@austin-williams.com wrote: Hmmm. Those pages are static and http://www.austin-williams.com/people/barbara-esposito.cfm looks fine from here. What are you seeing? What browser are you on? As far as the pictures, I'm the Technology Director, not the Creative Director. That is ground on which I do not tread :-) Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged __ Information from ESET Smart Security, version of virus signature database 5318 (20100727) __ The message was checked by ESET Smart Security. http://www.eset.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335765 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Help
This is neither here nor there, but the URLRewriteFilter can go on the actual application server, thus negating the need for IIS or Apache intervention, and as an added bonus, can do outbound rules as well. This means that you don't need to change your internal links from: index.cfm?somevar=woohoo, and instead can do this: getPageContext().getResponse().encode(index.cfm?somevar=woohoo) and have the HTML href that is returned to the client look like this: /somevar/woohoo (and obviously have incoming /somevar/woohoo requests translated to index.cfm?somevar=woohoo). You still have to wrap stuff with the encode() deal, so it's not super-cool if you've got a lot of links various places, but it's probably a pretty fast way to go pretty URL style without having to do much more than wrap your links with encode(). Just food for thought. I'm really liking it, and it doesn't add much overhead. I know this probably doesn't make much sense, but I can elaborate if anyone is actually interested. :) :Den -- There is a specter haunting Europe, the specter of Communism. Karl Marx On Tue, Jul 27, 2010 at 9:23 AM, Robert Harrison wrote: Why not use url rewrite instead? If it's this: http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/ that looks good but it also requires server IIS intervention. That does not solve the problem on all my sites and all the servers they are running on. Building them into my own CMS permanently solves the problem and keeps my tools portable for various server environments. In the long run it's I'm thinking it's probably best to make my CMS tools just work that way so I'm not thwarted by an uncooperative host. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335772 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Help
rereplace( myvar, '-+', '-', 'all' ) On Mon, Jul 26, 2010 at 10:59 AM, Robert Harrison rob...@austin-williams.com wrote: I want to replace any occurrence of multiple -- in string so the entire string only contains one - in a row after filtering. Something like this does (sort of): #Replacelist(#mayvar#,-,,---,--,-,-,-,-)# But with regex more like: #ReReplace(#myvar#,--,-,ALL)# How do I write a reg to change all multiple -- to result in only one -? Thanks Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged __ Information from ESET Smart Security, version of virus signature database 5315 (20100726) __ The message was checked by ESET Smart Security. http://www.eset.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335720 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Help
OT: Isn't regex elegant? Often very cryptic but any solution where I've used regex seems both sophisticated and simple. As you were. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335721 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex Help
Thanks... I just could not get that straight. Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged -Original Message- From: Charlie Griefer [mailto:charlie.grie...@gmail.com] Sent: Monday, July 26, 2010 2:04 PM To: cf-talk Subject: Re: Regex Help rereplace( myvar, '-+', '-', 'all' ) On Mon, Jul 26, 2010 at 10:59 AM, Robert Harrison rob...@austin-williams.com wrote: I want to replace any occurrence of multiple -- in string so the entire string only contains one - in a row after filtering. Something like this does (sort of): #Replacelist(#mayvar#,-,,---,--,-,-,-,-)# But with regex more like: #ReReplace(#myvar#,--,-,ALL)# How do I write a reg to change all multiple -- to result in only one -? Thanks Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged __ Information from ESET Smart Security, version of virus signature database 5315 (20100726) __ The message was checked by ESET Smart Security. http://www.eset.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335722 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex Help
http://www.cftagstore.com/tags/cfreextract.cfm :) -Original Message- From: Robert Harrison [mailto:rob...@austin-williams.com] Sent: Monday, July 26, 2010 1:00 PM To: cf-talk Subject: Regex Help I want to replace any occurrence of multiple -- in string so the entire string only contains one - in a row after filtering. Something like this does (sort of): #Replacelist(#mayvar#,-,,---,--,-,-,-,-)# But with regex more like: #ReReplace(#myvar#,--,-,ALL)# How do I write a reg to change all multiple -- to result in only one -? Thanks Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged __ Information from ESET Smart Security, version of virus signature database 5315 (20100726) __ The message was checked by ESET Smart Security. http://www.eset.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335723 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Help
troublemaker :D On Mon, Jul 26, 2010 at 12:02 PM, Andy Matthews li...@commadelimited.comwrote: http://www.cftagstore.com/tags/cfreextract.cfm :) -Original Message- From: Robert Harrison [mailto:rob...@austin-williams.com] Sent: Monday, July 26, 2010 1:00 PM To: cf-talk Subject: Regex Help I want to replace any occurrence of multiple -- in string so the entire string only contains one - in a row after filtering. Something like this does (sort of): #Replacelist(#mayvar#,-,,---,--,-,-,-,-)# But with regex more like: #ReReplace(#myvar#,--,-,ALL)# How do I write a reg to change all multiple -- to result in only one -? Thanks Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged __ Information from ESET Smart Security, version of virus signature database 5315 (20100726) __ The message was checked by ESET Smart Security. http://www.eset.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335724 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex Help
Sigh... .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Andy Matthews [mailto:li...@commadelimited.com] Sent: Monday, July 26, 2010 3:03 PM To: cf-talk Subject: RE: Regex Help [Completely irrelevant link removed] :) -Original Message- From: Robert Harrison [mailto:rob...@austin-williams.com] Sent: Monday, July 26, 2010 1:00 PM To: cf-talk Subject: Regex Help I want to replace any occurrence of multiple -- in string so the entire string only contains one - in a row after filtering. Something like this does (sort of): #Replacelist(#mayvar#,-,,---,--,-,-,-,-)# But with regex more like: #ReReplace(#myvar#,--,-,ALL)# How do I write a reg to change all multiple -- to result in only one -? Thanks Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or.? It must be?. Plug in to our blog:?AW Unplugged http://www.austin-williams.com/unplugged __ Information from ESET Smart Security, version of virus signature database 5315 (20100726) __ The message was checked by ESET Smart Security. http://www.eset.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335738 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex Help
You know I was kidding right? -Original Message- From: Bobby Hartsfield [mailto:bo...@acoderslife.com] Sent: Monday, July 26, 2010 6:21 PM To: cf-talk Subject: RE: Regex Help Sigh... .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Andy Matthews [mailto:li...@commadelimited.com] Sent: Monday, July 26, 2010 3:03 PM To: cf-talk Subject: RE: Regex Help [Completely irrelevant link removed] :) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335742 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Help
kidding? i already spent $15! On Mon, Jul 26, 2010 at 6:52 PM, andy matthews li...@commadelimited.comwrote: You know I was kidding right? -Original Message- From: Bobby Hartsfield [mailto:bo...@acoderslife.com] Sent: Monday, July 26, 2010 6:21 PM To: cf-talk Subject: RE: Regex Help Sigh... .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Andy Matthews [mailto:li...@commadelimited.com] Sent: Monday, July 26, 2010 3:03 PM To: cf-talk Subject: RE: Regex Help [Completely irrelevant link removed] :) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335743 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Lin Break Oddness
On Thu, Jul 1, 2010 at 3:31 PM, Ian Skinner wrote: ... Other then just breaking down and working this in IE does anybody have any other thoughs on what is going on here? Assuming I haven't totally misunderstood what's going on: You could drop to java and an XML lib that respects whitespace. It's a common problem, I think. Some people use Jericho (a tag parsing lib) for XML because it respects whitespace some XML parsers don't, if I'm remembering the comments right. I wouldn't recommend that one specifically, as it doesn't do XSLT transforms. :) It would probably be best if you used a java lib that isn't included with other stuff, as those XML libs can be mad conflicting. That's all I can think of, maybe there's some simple way to use built in stuff tho. Replace the new chunk with the old chunk after the transform by hand? Etc. :den -- The reason why men enter into society is the preservation of their property. John Lock ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335024 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: RegEx help
Thanks for the help, Jason and Andy. Turns out the character apparently isn't a tab though. Viewing it in WireShark, it looks like there is a carriage return (0d), a line feed (0a) and a space (20) between the age and gender strings. Sorry to be so dumb, but I've managed to avoid regular expressions for the most part, so I'm really clueless now that I need it. I've tried reading through the documentation but it all seems like Greek to me. How can I test for the combination of those three characters? Deb -Original Message- From: Jason Fisher [mailto:ja...@wanax.com] Sent: Monday, June 07, 2010 4:27 PM To: cf-talk Subject: RE: RegEx help Assuming that those are tabs between the elements, the following will expand on Andy's suggestion. cfset testString = Case Information Problem:diff breathing Patients:1 Four commandment Information Age:2 months Gender:Female Conscious:Yes Brea / cfset test = reFind(Age:([0-9a-zA-Z ]+)\t, testString, 1, true) / cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput From: Andy Matthews li...@commadelimited.com Sent: Monday, June 07, 2010 3:32 PM To: cf-talk cf-talk@houseoffusion.com Subject: RE: RegEx help If you can always depend on Age: before the desired string, and what looks like a tab afterwards, then it's trivial: Age:[0-9a-Z]+\t That assumes that the age will be any combination of letters and numbers, and also allows for upper and lower case. andy -Original Message- From: Debbie Morris [mailto:ddicker...@macromedia.com] Sent: Monday, June 07, 2010 1:51 PM To: cf-talk Subject: RegEx help I need to extract a particular piece of data from one of my query fields and I'm not sure how to go about it. We have incidents in one table that can have comments in another table associated with them. Here's an example of one of the comments in my query results that I need to grab data from: Case Information Problem:diff breathing Patients:1 Four commandment Information Age:2 months Gender:Female Conscious:Yes Brea I need to get the Age information for any comments that contain it. The Age field always begins as shown above and the Gender field always immediately follows it, so I'm assuming I can work from that, but I just don't know how to go about writing it. Any thoughts would be greatly appreciated!! Deb ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334360 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: RegEx help
If you mean test for that exact order of those three characters, you don't really need a regex for that. It is just a constant string. I believe it would be #Chr(13) chr(10) ' '# .:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Debbie Morris [mailto:dmor...@sussexcountyde.gov] Sent: Tuesday, June 08, 2010 10:23 AM To: cf-talk Subject: RE: RegEx help Thanks for the help, Jason and Andy. Turns out the character apparently isn't a tab though. Viewing it in WireShark, it looks like there is a carriage return (0d), a line feed (0a) and a space (20) between the age and gender strings. Sorry to be so dumb, but I've managed to avoid regular expressions for the most part, so I'm really clueless now that I need it. I've tried reading through the documentation but it all seems like Greek to me. How can I test for the combination of those three characters? Deb -Original Message- From: Jason Fisher [mailto:ja...@wanax.com] Sent: Monday, June 07, 2010 4:27 PM To: cf-talk Subject: RE: RegEx help Assuming that those are tabs between the elements, the following will expand on Andy's suggestion. cfset testString = Case Information Problem:diff breathing Patients:1 Four commandment Information Age:2 months Gender:Female Conscious:Yes Brea / cfset test = reFind(Age:([0-9a-zA-Z ]+)\t, testString, 1, true) / cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput From: Andy Matthews li...@commadelimited.com Sent: Monday, June 07, 2010 3:32 PM To: cf-talk cf-talk@houseoffusion.com Subject: RE: RegEx help If you can always depend on Age: before the desired string, and what looks like a tab afterwards, then it's trivial: Age:[0-9a-Z]+\t That assumes that the age will be any combination of letters and numbers, and also allows for upper and lower case. andy -Original Message- From: Debbie Morris [mailto:ddicker...@macromedia.com] Sent: Monday, June 07, 2010 1:51 PM To: cf-talk Subject: RegEx help I need to extract a particular piece of data from one of my query fields and I'm not sure how to go about it. We have incidents in one table that can have comments in another table associated with them. Here's an example of one of the comments in my query results that I need to grab data from: Case Information Problem:diff breathing Patients:1 Four commandment Information Age:2 months Gender:Female Conscious:Yes Brea I need to get the Age information for any comments that contain it. The Age field always begins as shown above and the Gender field always immediately follows it, so I'm assuming I can work from that, but I just don't know how to go about writing it. Any thoughts would be greatly appreciated!! Deb ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334361 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: RegEx help
I think he wants to make it part of the t-sql code. Do you really need to test for all three of these? Will there ever be a carriage return in the Age value that's valid? If not why not just test for the carriage return alone as the end part of your regex? On Tue, Jun 8, 2010 at 11:01 AM, Bobby Hartsfield bo...@acoderslife.comwrote: If you mean test for that exact order of those three characters, you don't really need a regex for that. It is just a constant string. I believe it would be #Chr(13) chr(10) ' '# .:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Debbie Morris [mailto:dmor...@sussexcountyde.gov] Sent: Tuesday, June 08, 2010 10:23 AM To: cf-talk Subject: RE: RegEx help Thanks for the help, Jason and Andy. Turns out the character apparently isn't a tab though. Viewing it in WireShark, it looks like there is a carriage return (0d), a line feed (0a) and a space (20) between the age and gender strings. Sorry to be so dumb, but I've managed to avoid regular expressions for the most part, so I'm really clueless now that I need it. I've tried reading through the documentation but it all seems like Greek to me. How can I test for the combination of those three characters? Deb -Original Message- From: Jason Fisher [mailto:ja...@wanax.com] Sent: Monday, June 07, 2010 4:27 PM To: cf-talk Subject: RE: RegEx help Assuming that those are tabs between the elements, the following will expand on Andy's suggestion. cfset testString = Case Information Problem:diff breathing Patients:1 Four commandment Information Age:2 months Gender:Female Conscious:Yes Brea / cfset test = reFind(Age:([0-9a-zA-Z ]+)\t, testString, 1, true) / cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput From: Andy Matthews li...@commadelimited.com Sent: Monday, June 07, 2010 3:32 PM To: cf-talk cf-talk@houseoffusion.com Subject: RE: RegEx help If you can always depend on Age: before the desired string, and what looks like a tab afterwards, then it's trivial: Age:[0-9a-Z]+\t That assumes that the age will be any combination of letters and numbers, and also allows for upper and lower case. andy -Original Message- From: Debbie Morris [mailto:ddicker...@macromedia.com] Sent: Monday, June 07, 2010 1:51 PM To: cf-talk Subject: RegEx help I need to extract a particular piece of data from one of my query fields and I'm not sure how to go about it. We have incidents in one table that can have comments in another table associated with them. Here's an example of one of the comments in my query results that I need to grab data from: Case Information Problem:diff breathing Patients:1 Four commandment Information Age:2 months Gender:Female Conscious:Yes Brea I need to get the Age information for any comments that contain it. The Age field always begins as shown above and the Gender field always immediately follows it, so I'm assuming I can work from that, but I just don't know how to go about writing it. Any thoughts would be greatly appreciated!! Deb ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334362 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: RegEx help
Oh. I never saw mention of that... and I think it's a she ;-) .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Tuesday, June 08, 2010 11:06 AM To: cf-talk Subject: Re: RegEx help I think he wants to make it part of the t-sql code. Do you really need to test for all three of these? Will there ever be a carriage return in the Age value that's valid? If not why not just test for the carriage return alone as the end part of your regex? On Tue, Jun 8, 2010 at 11:01 AM, Bobby Hartsfield bo...@acoderslife.comwrote: If you mean test for that exact order of those three characters, you don't really need a regex for that. It is just a constant string. I believe it would be #Chr(13) chr(10) ' '# .:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Debbie Morris [mailto:dmor...@sussexcountyde.gov] Sent: Tuesday, June 08, 2010 10:23 AM To: cf-talk Subject: RE: RegEx help Thanks for the help, Jason and Andy. Turns out the character apparently isn't a tab though. Viewing it in WireShark, it looks like there is a carriage return (0d), a line feed (0a) and a space (20) between the age and gender strings. Sorry to be so dumb, but I've managed to avoid regular expressions for the most part, so I'm really clueless now that I need it. I've tried reading through the documentation but it all seems like Greek to me. How can I test for the combination of those three characters? Deb -Original Message- From: Jason Fisher [mailto:ja...@wanax.com] Sent: Monday, June 07, 2010 4:27 PM To: cf-talk Subject: RE: RegEx help Assuming that those are tabs between the elements, the following will expand on Andy's suggestion. cfset testString = Case Information Problem:diff breathing Patients:1 Four commandment Information Age:2 months Gender:Female Conscious:Yes Brea / cfset test = reFind(Age:([0-9a-zA-Z ]+)\t, testString, 1, true) / cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput From: Andy Matthews li...@commadelimited.com Sent: Monday, June 07, 2010 3:32 PM To: cf-talk cf-talk@houseoffusion.com Subject: RE: RegEx help If you can always depend on Age: before the desired string, and what looks like a tab afterwards, then it's trivial: Age:[0-9a-Z]+\t That assumes that the age will be any combination of letters and numbers, and also allows for upper and lower case. andy -Original Message- From: Debbie Morris [mailto:ddicker...@macromedia.com] Sent: Monday, June 07, 2010 1:51 PM To: cf-talk Subject: RegEx help I need to extract a particular piece of data from one of my query fields and I'm not sure how to go about it. We have incidents in one table that can have comments in another table associated with them. Here's an example of one of the comments in my query results that I need to grab data from: Case Information Problem:diff breathing Patients:1 Four commandment Information Age:2 months Gender:Female Conscious:Yes Brea I need to get the Age information for any comments that contain it. The Age field always begins as shown above and the Gender field always immediately follows it, so I'm assuming I can work from that, but I just don't know how to go about writing it. Any thoughts would be greatly appreciated!! Deb ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334363 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: RegEx help
I'm wrong. I re-read it and it says query fields which when I first read I took as database column. My mistake. And sorry Debbie. She, not he. *_* On Tue, Jun 8, 2010 at 11:18 AM, Bobby Hartsfield bo...@acoderslife.comwrote: Oh. I never saw mention of that... and I think it's a she ;-) .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Tuesday, June 08, 2010 11:06 AM To: cf-talk Subject: Re: RegEx help I think he wants to make it part of the t-sql code. Do you really need to test for all three of these? Will there ever be a carriage return in the Age value that's valid? If not why not just test for the carriage return alone as the end part of your regex? On Tue, Jun 8, 2010 at 11:01 AM, Bobby Hartsfield bo...@acoderslife.comwrote: If you mean test for that exact order of those three characters, you don't really need a regex for that. It is just a constant string. I believe it would be #Chr(13) chr(10) ' '# .:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Debbie Morris [mailto:dmor...@sussexcountyde.gov] Sent: Tuesday, June 08, 2010 10:23 AM To: cf-talk Subject: RE: RegEx help Thanks for the help, Jason and Andy. Turns out the character apparently isn't a tab though. Viewing it in WireShark, it looks like there is a carriage return (0d), a line feed (0a) and a space (20) between the age and gender strings. Sorry to be so dumb, but I've managed to avoid regular expressions for the most part, so I'm really clueless now that I need it. I've tried reading through the documentation but it all seems like Greek to me. How can I test for the combination of those three characters? Deb -Original Message- From: Jason Fisher [mailto:ja...@wanax.com] Sent: Monday, June 07, 2010 4:27 PM To: cf-talk Subject: RE: RegEx help Assuming that those are tabs between the elements, the following will expand on Andy's suggestion. cfset testString = Case Information Problem:diff breathing Patients:1 Four commandment Information Age:2 months Gender:Female Conscious:Yes Brea / cfset test = reFind(Age:([0-9a-zA-Z ]+)\t, testString, 1, true) / cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput From: Andy Matthews li...@commadelimited.com Sent: Monday, June 07, 2010 3:32 PM To: cf-talk cf-talk@houseoffusion.com Subject: RE: RegEx help If you can always depend on Age: before the desired string, and what looks like a tab afterwards, then it's trivial: Age:[0-9a-Z]+\t That assumes that the age will be any combination of letters and numbers, and also allows for upper and lower case. andy -Original Message- From: Debbie Morris [mailto:ddicker...@macromedia.com] Sent: Monday, June 07, 2010 1:51 PM To: cf-talk Subject: RegEx help I need to extract a particular piece of data from one of my query fields and I'm not sure how to go about it. We have incidents in one table that can have comments in another table associated with them. Here's an example of one of the comments in my query results that I need to grab data from: Case Information Problem:diff breathing Patients:1 Four commandment Information Age:2 months Gender:Female Conscious:Yes Brea I need to get the Age information for any comments that contain it. The Age field always begins as shown above and the Gender field always immediately follows it, so I'm assuming I can work from that, but I just don't know how to go about writing it. Any thoughts would be greatly appreciated!! Deb ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334364 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: RegEx help
How about something like this: cfset arFound = refindnocase(Age:([^\r\n|\r|\n]*)[\r\n|\r|\n],thestring,1,true) / cfoutput#mid(thestring,arFound[pos][1],arFound[len][1])#/cfoutput Cheers, Kris ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334365 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: RegEx help
Rather, that would be, if you don't want the label of the field: cfoutput#mid(thestring,arFound[pos][2],arFound[len][2])#/cfoutput Cheers, Kris On Tue, Jun 8, 2010 at 11:43 AM, Kris Jones kris.jon...@verizon.net wrote: How about something like this: cfset arFound = refindnocase(Age:([^\r\n|\r|\n]*)[\r\n|\r|\n],thestring,1,true) / cfoutput#mid(thestring,arFound[pos][1],arFound[len][1])#/cfoutput ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334366 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: RegEx help
Debbie, Where 'testString' is your content, try this: cfset test = reFind(Age:([0-9a-zA-Z ]+)\s*\n, testString, 1, true) / cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput From: Debbie Morris dmor...@sussexcountyde.gov Sent: Tuesday, June 08, 2010 10:24 AM To: cf-talk cf-talk@houseoffusion.com Subject: RE: RegEx help Thanks for the help, Jason and Andy. Turns out the character apparently isn't a tab though. Viewing it in WireShark, it looks like there is a carriage return (0d), a line feed (0a) and a space (20) between the age and gender strings. Sorry to be so dumb, but I've managed to avoid regular expressions for the most part, so I'm really clueless now that I need it. I've tried reading through the documentation but it all seems like Greek to me. How can I test for the combination of those three characters? Deb -Original Message- From: Jason Fisher [mailto:ja...@wanax.com] Sent: Monday, June 07, 2010 4:27 PM To: cf-talk Subject: RE: RegEx help Assuming that those are tabs between the elements, the following will expand on Andy's suggestion. cfset testString = Case Information Problem:diff breathing Patients:1 Four commandment Information Age:2 months Gender:Female Conscious:Yes Brea / cfset test = reFind(Age:([0-9a-zA-Z ]+)\t, testString, 1, true) / cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput From: Andy Matthews li...@commadelimited.com Sent: Monday, June 07, 2010 3:32 PM To: cf-talk cf-talk@houseoffusion.com Subject: RE: RegEx help If you can always depend on Age: before the desired string, and what looks like a tab afterwards, then it's trivial: Age:[0-9a-Z]+\t That assumes that the age will be any combination of letters and numbers, and also allows for upper and lower case. andy -Original Message- From: Debbie Morris [mailto:ddicker...@macromedia.com] Sent: Monday, June 07, 2010 1:51 PM To: cf-talk Subject: RegEx help I need to extract a particular piece of data from one of my query fields and I'm not sure how to go about it. We have incidents in one table that can have comments in another table associated with them. Here's an example of one of the comments in my query results that I need to grab data from: Case Information Problem:diff breathing Patients:1 Four commandment Information Age:2 months Gender:Female Conscious:Yes Brea I need to get the Age information for any comments that contain it. The Age field always begins as shown above and the Gender field always immediately follows it, so I'm assuming I can work from that, but I just don't know how to go about writing it. Any thoughts would be greatly appreciated!! Deb ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334367 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: RegEx help
Thank you (and everyone else)!! This one did the trick! Now I just need to finish the logic around it so that it doesn't break when there aren't any comments that match, and I can get this off my plate before I leave for vacation! Thanks again! Deb -Original Message- From: Jason Fisher [mailto:ja...@wanax.com] Sent: Tuesday, June 08, 2010 11:40 AM To: cf-talk Subject: RE: RegEx help Debbie, Where 'testString' is your content, try this: cfset test = reFind(Age:([0-9a-zA-Z ]+)\s*\n, testString, 1, true) / cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput From: Debbie Morris dmor...@sussexcountyde.gov Sent: Tuesday, June 08, 2010 10:24 AM To: cf-talk cf-talk@houseoffusion.com Subject: RE: RegEx help Thanks for the help, Jason and Andy. Turns out the character apparently isn't a tab though. Viewing it in WireShark, it looks like there is a carriage return (0d), a line feed (0a) and a space (20) between the age and gender strings. Sorry to be so dumb, but I've managed to avoid regular expressions for the most part, so I'm really clueless now that I need it. I've tried reading through the documentation but it all seems like Greek to me. How can I test for the combination of those three characters? Deb -Original Message- From: Jason Fisher [mailto:ja...@wanax.com] Sent: Monday, June 07, 2010 4:27 PM To: cf-talk Subject: RE: RegEx help Assuming that those are tabs between the elements, the following will expand on Andy's suggestion. cfset testString = Case Information Problem:diff breathing Patients:1 Four commandment Information Age:2 months Gender:Female Conscious:Yes Brea / cfset test = reFind(Age:([0-9a-zA-Z ]+)\t, testString, 1, true) / cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput From: Andy Matthews li...@commadelimited.com Sent: Monday, June 07, 2010 3:32 PM To: cf-talk cf-talk@houseoffusion.com Subject: RE: RegEx help If you can always depend on Age: before the desired string, and what looks like a tab afterwards, then it's trivial: Age:[0-9a-Z]+\t That assumes that the age will be any combination of letters and numbers, and also allows for upper and lower case. andy -Original Message- From: Debbie Morris [mailto:ddicker...@macromedia.com] Sent: Monday, June 07, 2010 1:51 PM To: cf-talk Subject: RegEx help I need to extract a particular piece of data from one of my query fields and I'm not sure how to go about it. We have incidents in one table that can have comments in another table associated with them. Here's an example of one of the comments in my query results that I need to grab data from: Case Information Problem:diff breathing Patients:1 Four commandment Information Age:2 months Gender:Female Conscious:Yes Brea I need to get the Age information for any comments that contain it. The Age field always begins as shown above and the Gender field always immediately follows it, so I'm assuming I can work from that, but I just don't know how to go about writing it. Any thoughts would be greatly appreciated!! Deb ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334369 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: RegEx help
Vaca... vacati... hmmm, I'm not sure I'm familiar with that word. :-P .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Debbie Morris [mailto:dmor...@sussexcountyde.gov] Sent: Tuesday, June 08, 2010 12:45 PM To: cf-talk Subject: RE: RegEx help Thank you (and everyone else)!! This one did the trick! Now I just need to finish the logic around it so that it doesn't break when there aren't any comments that match, and I can get this off my plate before I leave for vacation! Thanks again! Deb -Original Message- From: Jason Fisher [mailto:ja...@wanax.com] Sent: Tuesday, June 08, 2010 11:40 AM To: cf-talk Subject: RE: RegEx help Debbie, Where 'testString' is your content, try this: cfset test = reFind(Age:([0-9a-zA-Z ]+)\s*\n, testString, 1, true) / cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput From: Debbie Morris dmor...@sussexcountyde.gov Sent: Tuesday, June 08, 2010 10:24 AM To: cf-talk cf-talk@houseoffusion.com Subject: RE: RegEx help Thanks for the help, Jason and Andy. Turns out the character apparently isn't a tab though. Viewing it in WireShark, it looks like there is a carriage return (0d), a line feed (0a) and a space (20) between the age and gender strings. Sorry to be so dumb, but I've managed to avoid regular expressions for the most part, so I'm really clueless now that I need it. I've tried reading through the documentation but it all seems like Greek to me. How can I test for the combination of those three characters? Deb -Original Message- From: Jason Fisher [mailto:ja...@wanax.com] Sent: Monday, June 07, 2010 4:27 PM To: cf-talk Subject: RE: RegEx help Assuming that those are tabs between the elements, the following will expand on Andy's suggestion. cfset testString = Case Information Problem:diff breathing Patients:1 Four commandment Information Age:2 months Gender:Female Conscious:Yes Brea / cfset test = reFind(Age:([0-9a-zA-Z ]+)\t, testString, 1, true) / cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput From: Andy Matthews li...@commadelimited.com Sent: Monday, June 07, 2010 3:32 PM To: cf-talk cf-talk@houseoffusion.com Subject: RE: RegEx help If you can always depend on Age: before the desired string, and what looks like a tab afterwards, then it's trivial: Age:[0-9a-Z]+\t That assumes that the age will be any combination of letters and numbers, and also allows for upper and lower case. andy -Original Message- From: Debbie Morris [mailto:ddicker...@macromedia.com] Sent: Monday, June 07, 2010 1:51 PM To: cf-talk Subject: RegEx help I need to extract a particular piece of data from one of my query fields and I'm not sure how to go about it. We have incidents in one table that can have comments in another table associated with them. Here's an example of one of the comments in my query results that I need to grab data from: Case Information Problem:diff breathing Patients:1 Four commandment Information Age:2 months Gender:Female Conscious:Yes Brea I need to get the Age information for any comments that contain it. The Age field always begins as shown above and the Gender field always immediately follows it, so I'm assuming I can work from that, but I just don't know how to go about writing it. Any thoughts would be greatly appreciated!! Deb ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334370 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: RegEx help
If you can always depend on Age: before the desired string, and what looks like a tab afterwards, then it's trivial: Age:[0-9a-Z]+\t That assumes that the age will be any combination of letters and numbers, and also allows for upper and lower case. andy -Original Message- From: Debbie Morris [mailto:ddicker...@macromedia.com] Sent: Monday, June 07, 2010 1:51 PM To: cf-talk Subject: RegEx help I need to extract a particular piece of data from one of my query fields and I'm not sure how to go about it. We have incidents in one table that can have comments in another table associated with them. Here's an example of one of the comments in my query results that I need to grab data from: Case Information Problem:diff breathing Patients:1 Four commandment Information Age:2 months Gender:Female Conscious:Yes Brea I need to get the Age information for any comments that contain it. The Age field always begins as shown above and the Gender field always immediately follows it, so I'm assuming I can work from that, but I just don't know how to go about writing it. Any thoughts would be greatly appreciated!! Deb ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334347 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: RegEx help
Assuming that those are tabs between the elements, the following will expand on Andy's suggestion. cfset testString = Case Information Problem:diff breathing Patients:1 Four commandment Information Age:2 months Gender:Female Conscious:Yes Brea / cfset test = reFind(Age:([0-9a-zA-Z ]+)\t, testString, 1, true) / cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput From: Andy Matthews li...@commadelimited.com Sent: Monday, June 07, 2010 3:32 PM To: cf-talk cf-talk@houseoffusion.com Subject: RE: RegEx help If you can always depend on Age: before the desired string, and what looks like a tab afterwards, then it's trivial: Age:[0-9a-Z]+\t That assumes that the age will be any combination of letters and numbers, and also allows for upper and lower case. andy -Original Message- From: Debbie Morris [mailto:ddicker...@macromedia.com] Sent: Monday, June 07, 2010 1:51 PM To: cf-talk Subject: RegEx help I need to extract a particular piece of data from one of my query fields and I'm not sure how to go about it. We have incidents in one table that can have comments in another table associated with them. Here's an example of one of the comments in my query results that I need to grab data from: Case Information Problem:diff breathing Patients:1 Four commandment Information Age:2 months Gender:Female Conscious:Yes Brea I need to get the Age information for any comments that contain it. The Age field always begins as shown above and the Gender field always immediately follows it, so I'm assuming I can work from that, but I just don't know how to go about writing it. Any thoughts would be greatly appreciated!! Deb ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334351 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex to remove script and style blocks
See http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0a38f-7ffb.html for the flag to trigger multi-line capabilities in regex. (?m)script\b[^]*.*?/script should do it. cfset newString = rereplaceNoCase( string , '(?m)script\b[^]*.*?/script' , '' , 'all' ) On Tue, Apr 6, 2010 at 9:29 PM, UXB Internet denn...@uxbinternet.comwrote: I am at a loss as to how to structure a regex to remove a JavaScript block from a file using CF5. What I am trying to do is remove the script and everything including and between /script. something like this: script language=JavaScript !-- JavaScript code here // -- /script I have tried this but it give me and error: Bad regular expression cfset Newstring = ReReplaceNoCase(string,script.*?.*?/script,, all) Assistance would be appreciated. Dennis Powers UXB Internet - A Website Design Hosting Company P.O. Box 6028 Wolcott, CT 06716 203-879-2844 http://www.uxbinternet.com ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332688 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex to remove script and style blocks
I have two mental blocks Secure certificates and REgEx. I am sure therapy might help smile but right now I just need to someone to tell me where I am going wrong. The rereplace does not seem to work. cfset newString = rereplaceNoCase( string , '(?m)script\b[^]*.*?/script' , '' , 'all' ) These are the actual code snippets I am trying to remove from a page: script type=text/javascript var gaJsHost = ((https: == document.location.protocol) ? https://ssl.; : http://www.;); document.write(unescape(%3Cscript src=' + gaJsHost + google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E)); /script script type=text/javascript try { var pageTracker = _gat._getTracker(); pageTracker._trackPageview(); } catch(err) {}/script/head -Original Message- From: Charlie Griefer [mailto:charlie.grie...@gmail.com] Sent: Wednesday, April 07, 2010 3:22 AM To: cf-talk Subject: Re: Regex to remove script and style blocks See http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172 e0811cbec0a38f-7ffb.html for the flag to trigger multi-line capabilities in regex. (?m)script\b[^]*.*?/script should do it. cfset newString = rereplaceNoCase( string , '(?m)script\b[^]*.*?/script' , '' , 'all' ) On Tue, Apr 6, 2010 at 9:29 PM, UXB Internet denn...@uxbinternet.comwrote: I am at a loss as to how to structure a regex to remove a JavaScript block from a file using CF5. What I am trying to do is remove the script and everything including and between /script. something like this: script language=JavaScript !-- JavaScript code here // -- /script I have tried this but it give me and error: Bad regular expression cfset Newstring = ReReplaceNoCase(string,script.*?.*?/script,, all) Assistance would be appreciated. Dennis Powers UXB Internet - A Website Design Hosting Company P.O. Box 6028 Wolcott, CT 06716 203-879-2844 http://www.uxbinternet.com ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332715 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: regex
That'll probably be matching against the full hostname, so try this: RewriteRule /[\w-]+/$ index.cfm\?name=$1 [NC,L] Also might be necessary to escape the slashes, so if that doesn't work give this a try: RewriteRule \/[\w-]+\/$ index.cfm\?name=$1 [NC,L] (Another thing you could try is using \z instead of the $, i.e. /[\w-]+/\z but I doubt that's the problem.) Oh, and I'm not sure if you need to escape the question mark in the second part? Try just index.cfm?name=$1 for that. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330133 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: regex
/\w+/ should work \w matches all word characters including letters (upper and lower), numbers, and some punctuation. Here's a really good beginners guide to regex that I wrote. http://andymatthews.net/read/2009/10/22/A-beginner's-guide-to-regular-expres sions andy -Original Message- From: Mik Muller [mailto:ad...@montaguema.net] Sent: Monday, January 25, 2010 9:01 AM To: cf-talk Subject: regex Can anyone give me a hand with this regex? I know it's very simple. Just don't have time to dig into it. I need something that will take only... /sometext/ /some-other-text/ ...and ignore the following... /sometext.ext?yadda=yaddaetc /images/filename.jpg In other words, the rule only runs if it appears to be a single folder name, and nothing else. Thanks, Mik Michael Muller Admin, MontagueMA.net Website ...a project of MontagueWebWorks.com mobile (413) 320-5336 http://www.MontagueMA.net Eschew Obfuscation ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330101 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: regex
The only punctuation that \w matches is underscore. To match hyphen also, use [\w-], which then gives the expression /[\w-]+/ (To match hyphen but not underscore [a-zA-Z0-9-] is what you want) NOTE: The hyphen must be first/last in the class, or be escaped with a backslash. To specifically ignore /images/filename.jpg you need to ensure the second slash is at the end of the string, (and the opening slash at the start), so use: ^/[\w-]+/$ ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330116 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: regex
Thanks. I'm using it in ISAPI-ReWrite to rewrite URLs. Although it works in the built-in regex tester (which is handy) it's not working on the server: RewriteRule (^/[\w-]+/$) index.cfm\?name=$1 [NC,L] Could be something else I think. I'm working with the support guy. Mik At 01:29 PM 1/25/2010, you wrote: The only punctuation that \w matches is underscore. To match hyphen also, use [\w-], which then gives the expression /[\w-]+/ (To match hyphen but not underscore [a-zA-Z0-9-] is what you want) NOTE: The hyphen must be first/last in the class, or be escaped with a backslash. To specifically ignore /images/filename.jpg you need to ensure the second slash is at the end of the string, (and the opening slash at the start), so use: ^/[\w-]+/$ ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330131 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Regex help with invalid HTML
I have no control over this code The only time parsing HTML with RegEx might be remotely viable is when you know what that code will be - if the HTML is uncontrolled then using RegEx is a futile effort. RegEx is for dealing with Regular text, and HTML is not a Regular language - even modern regex engines that implement non-Regular features *cannot* deal with the potential complexity of HTML. The correct solution is to **use a tool designed for parsing HTML**. There isn't one native to CF, but there are a number of Java ones available - take a look at: http://java-source.net/open-source/html-parsers I haven't used any of those, I'd probably start with TagSoup or NekoHTML since they look promising, but any HTML parser that produces a DOM structure which you can run XPath expressions against will allow you to extract the specific information you want. So yeah, it might involve a bit of effort getting one of those to work, but it's far more stable and reliable than attempting to use regex for something it simply isn't designed for. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328460 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Regex help with invalid HTML
List wrote at 17 November 2009 14:32: Andy matthews, you're welcome. Ah hah, that's a name I'm more familiar with. testing Roger. And excuse the previously poorly formatted code (it looked ok at my end before sending but occasionally in Outlook 2007 when I copy and paste from external apps that happens). Over and out. Mark ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328477 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Regex help with invalid HTML
Peter Boughton wrote on Wed 18/11/2009 at 03:12: The only time parsing HTML with RegEx might be remotely viable is when you know what that code will be - if the HTML is uncontrolled then using RegEx is a futile effort. RegEx is for dealing with Regular text, and HTML is not a Regular language - even modern regex engines that implement non-Regular features *cannot* deal with the potential complexity of HTML. The correct solution is to **use a tool designed for parsing HTML**. Ok Peter, thanks for the heads-up. There isn't one native to CF, but there are a number of Java ones available - take a look at: http://java-source.net/open-source/html-parsers I haven't used any of those, I'd probably start with TagSoup or NekoHTML since they look promising, but any HTML parser that produces a DOM structure which you can run XPath expressions against will allow you to extract the specific information you want. TagSoup it is. Mark ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328478 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Regex help with invalid HTML
Azadi Saryev wrote on 16 November 2009 at 17:58 you can do it with something like this: cfset line='trtd class=la href=/blah.com/atd31 622td25 623td193 645td840 642td1.9 GB' cfset cleanline = rereplace(line, 't[^]+', '|', 'all') cfoutput#listfirst(cleanline, '|')# #listlast(cleanline, '|')#/cfoutput and if you do not want any html in final result (not even a tag), then use: cfset cleanline = rereplace(line, '[^]+', '|', 'all') Thanks Azadi. That's all I needed to get the thought processes rolling in the right direction (it never occurred to me to check each entry was on a new line, so thanks also to the individual I can only refer to as list!). Here's the truncated code relevant to the question I asked that's working: cfhttp url=http://localhost/statsmerged.html; cfset sStartString = cfhttp.filecontent cfset sStartTag = FindNoCase(td class='l', sStartString) cfset sTempString = RemoveChars(sStartString,1, sStartTag-1) cfset sEndTag = FindNoCase(/table, sTempString) cfset sFinalString = RemoveChars(sTempString,sEndTag, Len(sTempString)) cfloop index=thisLine list=#sFinalString# delimiters=#chr(10)##chr(13)# cfset cleanLine = ReReplace(thisLine, '[^]+', '|', 'all') cfoutput#listFirst(cleanLine, '|')# #listLast(cleanLine, '|')#/cfoutput /cfloop ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328444 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Regex help with invalid HTML
Andy matthews, you're welcome. -Original Message- From: Mark Henderson [mailto:m...@cwc.co.nz] Sent: Monday, November 16, 2009 4:29 PM To: cf-talk Subject: RE: Regex help with invalid HTML Azadi Saryev wrote on 16 November 2009 at 17:58 you can do it with something like this: cfset line='trtd class=la href=/blah.com/atd31 622td25 623td193 645td840 642td1.9 GB' cfset cleanline = rereplace(line, 't[^]+', '|', 'all') cfoutput#listfirst(cleanline, '|')# #listlast(cleanline, '|')#/cfoutput and if you do not want any html in final result (not even a tag), then use: cfset cleanline = rereplace(line, '[^]+', '|', 'all') Thanks Azadi. That's all I needed to get the thought processes rolling in the right direction (it never occurred to me to check each entry was on a new line, so thanks also to the individual I can only refer to as list!). Here's the truncated code relevant to the question I asked that's working: cfhttp url=http://localhost/statsmerged.html; cfset sStartString = cfhttp.filecontent cfset sStartTag = FindNoCase(td class='l', sStartString) cfset sTempString = RemoveChars(sStartString,1, sStartTag-1) cfset sEndTag = FindNoCase(/table, sTempString) cfset sFinalString = RemoveChars(sTempString,sEndTag, Len(sTempString)) cfloop index=thisLine list=#sFinalString# delimiters=#chr(10)##chr(13)# cfset cleanLine = ReReplace(thisLine, '[^]+', '|', 'all') cfoutput#listFirst(cleanLine, '|')# #listLast(cleanLine, '|')#/cfoutput /cfloop ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328450 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Regex help with invalid HTML
testing -Original Message- From: Mark Henderson [mailto:m...@cwc.co.nz] Sent: Monday, November 16, 2009 4:29 PM To: cf-talk Subject: RE: Regex help with invalid HTML Azadi Saryev wrote on 16 November 2009 at 17:58 you can do it with something like this: cfset line='trtd class=la href=/blah.com/atd31 622td25 623td193 645td840 642td1.9 GB' cfset cleanline = rereplace(line, 't[^]+', '|', 'all') cfoutput#listfirst(cleanline, '|')# #listlast(cleanline, '|')#/cfoutput and if you do not want any html in final result (not even a tag), then use: cfset cleanline = rereplace(line, '[^]+', '|', 'all') Thanks Azadi. That's all I needed to get the thought processes rolling in the right direction (it never occurred to me to check each entry was on a new line, so thanks also to the individual I can only refer to as list!). Here's the truncated code relevant to the question I asked that's working: cfhttp url=http://localhost/statsmerged.html; cfset sStartString = cfhttp.filecontent cfset sStartTag = FindNoCase(td class='l', sStartString) cfset sTempString = RemoveChars(sStartString,1, sStartTag-1) cfset sEndTag = FindNoCase(/table, sTempString) cfset sFinalString = RemoveChars(sTempString,sEndTag, Len(sTempString)) cfloop index=thisLine list=#sFinalString# delimiters=#chr(10)##chr(13)# cfset cleanLine = ReReplace(thisLine, '[^]+', '|', 'all') cfoutput#listFirst(cleanLine, '|')# #listLast(cleanLine, '|')#/cfoutput /cfloop ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328451 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Regex help with invalid HTML
Will it always be a domain name you want to keep? And will the file size always be at the very end of the line? -Original Message- From: Mark Henderson [mailto:m...@cwc.co.nz] Sent: Sunday, November 15, 2009 8:38 PM To: cf-talk Subject: Regex help with invalid HTML Calling all regex gurus. I've spent a little time on this so now it's time to seek advice from the professionals. Here is an example of the content I'm working with: trtd class=la href=/abc.co.nz/atd52 363td73 815td5 122 265td2 166 760td471.47 MB trtd class=la href=/xyz.co.nz/atd31 622td23 443td193 645td840 642td1.8 GB trtd class=la href=/blah.com/atd31 622td25 623td193 645td840 642td1.9 GB And what I want to do is remove everything between the first td (after the closing /a) and the last td BEFORE the next tr. E.G. This trtd class=la href=/abc.co.nz/atd52 363td73 815td5 122 265td2 166 760td471.47 MB becomes trtd class=la href=/abc.co.nz/a 471.47 MB At that point I will then strip all the remaining HTML tags (which I can do) and I should be good to go. Unfortunately I have no control over this code as it is generated by a stats program, and if indeed it used the correct closing tags and validated I could probably fumble around and eventually achieve what I want, as I've done in the past. And just in case anyone out there can do all this in one hit, ultimately I want the output from above to look like this: abc.co.nz 471.47 MB xyz.co.nz 1.8 GB blah.com 1.9 GB etc. I hope that makes sense. TIA Mark ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328403 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Regex help with invalid HTML
lists wrote: Will it always be a domain name you want to keep? And will the file size always be at the very end of the line? Yes, and yes (confirmed all the TRs start on a new line). Regards Mark ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328404 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Regex help with invalid HTML
you can do it with something like this: cfset line='trtd class=la href=/blah.com/atd31 622td25 623td193 645td840 642td1.9 GB' cfset cleanline = rereplace(line, 't[^]+', '|', 'all') cfoutput#listfirst(cleanline, '|')# #listlast(cleanline, '|')#/cfoutput and if you do not want any html in final result (not even a tag), then use: cfset cleanline = rereplace(line, '[^]+', '|', 'all') Azadi Saryev On 16/11/2009 10:37, Mark Henderson wrote: Calling all regex gurus. I've spent a little time on this so now it's time to seek advice from the professionals. Here is an example of the content I'm working with: trtd class=la href=/abc.co.nz/atd52 363td73 815td5 122 265td2 166 760td471.47 MB trtd class=la href=/xyz.co.nz/atd31 622td23 443td193 645td840 642td1.8 GB trtd class=la href=/blah.com/atd31 622td25 623td193 645td840 642td1.9 GB And what I want to do is remove everything between the first td (after the closing /a) and the last td BEFORE the next tr. E.G. This trtd class=la href=/abc.co.nz/atd52 363td73 815td5 122 265td2 166 760td471.47 MB becomes trtd class=la href=/abc.co.nz/a 471.47 MB At that point I will then strip all the remaining HTML tags (which I can do) and I should be good to go. Unfortunately I have no control over this code as it is generated by a stats program, and if indeed it used the correct closing tags and validated I could probably fumble around and eventually achieve what I want, as I've done in the past. And just in case anyone out there can do all this in one hit, ultimately I want the output from above to look like this: abc.co.nz 471.47 MB xyz.co.nz 1.8 GB blah.com 1.9 GB etc. I hope that makes sense. TIA Mark ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328405 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Regex Help - Can this be simplified?
The easiest to read solution is one line: cfset finalDescription = fiddleWithParas(form.description) / Of course, that function will then contain a nicely spaced easy-to-read piece of logic, which almost certainly wont be a horrible single line of nested replaces. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325495 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Regex Help - Can this be simplified?
I'm not an expert with Regex, but you could do this: cfset finalDescription = replace(replace(replace(trim(form.description),br,br/,all),p/p ,br /br /,all),p,br /br /,all) Again, this is not regex, but it is a much more simplified (and faster I believe) way of doing the same thing with 1 line of code. Dave Phillips -Original Message- From: Che Vilnonis [mailto:ch...@asitv.com] Sent: Thursday, August 13, 2009 1:14 PM To: cf-talk Subject: Regex Help - Can this be simplified? Is there a way using CF's Regex functions to simplfy the lines of code below into one line? Some kind of built in regex list comparison maybe? cfset finalDescription = replace(trim(form.description), br, br /, ALL) cfset finalDescription = replace(finalDescription, p/p, br /br /, ALL) cfset finalDescription = replace(finalDescription, p, br /br /, ALL) Thanks, CV ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325436 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4