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
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 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 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: 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
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 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
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
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:358937 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Need RegEx help for unknown/odd characters.
How about making sure the charset is set properly. I have seen this kind of thing when not setting to UTF-8. This can be a problem either on the ingesting, or when the feed is written. On Fri, May 17, 2013 at 2:25 PM, Che Vilnonis wrote: > > Nathan, the problem is that within the feed itself, the characters don't > have accents. When output to a browser, they funky chars display on screen > with odd geometric shapes like an upright rectangle. They're like odd ascii > chars that I have only seen a few time before. In the end, I can't insert > them into the MySQL db. > > Ché > > -Original Message- > > > How about deAccent() ? > http://cflib.org/udf/deAccent > > > On Wed, May 15, 2013 at 9:20 AM, Che Vilnonis wrote: > > > > > Good morning. Occasionally when parsing a RSS feed, I get RSS data I > > cannot parse. Click for screenshot below (text highlighted in green). > > In this example, Montreal should return "Montréal" but does not. What > > regex could I use to remove or replace such odd characters? > > > > http://www.asitv.com/images/_funkychar.jpg > > > > > ~| 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:355763 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Need RegEx help for unknown/odd characters.
Nathan, the problem is that within the feed itself, the characters don't have accents. When output to a browser, they funky chars display on screen with odd geometric shapes like an upright rectangle. They're like odd ascii chars that I have only seen a few time before. In the end, I can't insert them into the MySQL db. Ché -Original Message- How about deAccent() ? http://cflib.org/udf/deAccent On Wed, May 15, 2013 at 9:20 AM, Che Vilnonis wrote: > > Good morning. Occasionally when parsing a RSS feed, I get RSS data I > cannot parse. Click for screenshot below (text highlighted in green). > In this example, Montreal should return "Montréal" but does not. What > regex could I use to remove or replace such odd characters? > > http://www.asitv.com/images/_funkychar.jpg ~| 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:355762 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Need RegEx help for unknown/odd characters.
How about deAccent() ? http://cflib.org/udf/deAccent nathan strutz [www.dopefly.com] [hi.im/nathanstrutz] On Wed, May 15, 2013 at 9:20 AM, Che Vilnonis wrote: > > Good morning. Occasionally when parsing a RSS feed, I get RSS data I cannot > parse. Click for screenshot below (text highlighted in green). In this > example, Montreal should return "Montréal" but does not. What regex could I > use to remove or replace such odd characters? > > http://www.asitv.com/images/_funkychar.jpg > > Thanks, 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:355757 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Need RegEx help for unknown/odd characters.
Good afternoon. Occasionally when parsing a RSS feed, I get RSS data I cannot parse. Click for screenshot below (text highlighted in green). In this example, Montreal should return "Montréal" but does not. What regex could I use to remove or replace such odd characters? http://www.asitv.com/images/_funkychar.jpg Thanks, 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:355737 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Need RegEx help for unknown/odd characters.
Good morning. Occasionally when parsing a RSS feed, I get RSS data I cannot parse. Click for screenshot below (text highlighted in green). In this example, Montreal should return "Montréal" but does not. What regex could I use to remove or replace such odd characters? http://www.asitv.com/images/_funkychar.jpg Thanks, 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:355733 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 > > > 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
Regex help needed
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 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:342201 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
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: A&W 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
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: A&W 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
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
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: A&W 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
> 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: A&W 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
> 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. 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=category&term=$1 RewriteRule search/([a-zA-Z0-9-,]+) index.cfm?verb=search&term=$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=category&term=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: A&W 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: A&W 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
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: A&W 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 > wrote: > > > > > 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
> 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: A&W 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: A&W 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
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: A&W 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? 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: A&W 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
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: A&W 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 > wrote: > > > > > 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
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: A&W 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 wrote: > > 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
I hope he does because your post literally made me laugh out loud. On Mon, Jul 26, 2010 at 8:52 PM, andy matthews wrote: > > 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
kidding? i already spent $15! On Mon, Jul 26, 2010 at 6:52 PM, andy matthews wrote: > > 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 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
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:?A&W 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
troublemaker :D On Mon, Jul 26, 2010 at 12:02 PM, Andy Matthews wrote: > > 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: A&W 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
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: A&W 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
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: A&W 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: A&W 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
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
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: A&W 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
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: A&W 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:335719 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: #mid(testString, test.pos[2], test.len[2])# From: "Debbie Morris" Sent: Tuesday, June 08, 2010 10:24 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. #mid(testString, test.pos[2], test.len[2])# From: "Andy Matthews" Sent: Monday, June 07, 2010 3:32 PM To: "cf-talk" 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
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: #mid(testString, test.pos[2], test.len[2])# From: "Debbie Morris" Sent: Tuesday, June 08, 2010 10:24 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. #mid(testString, test.pos[2], test.len[2])# From: "Andy Matthews" Sent: Monday, June 07, 2010 3:32 PM To: "cf-talk" 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
Debbie, Where 'testString' is your content, try this: #mid(testString, test.pos[2], test.len[2])# From: "Debbie Morris" Sent: Tuesday, June 08, 2010 10:24 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. #mid(testString, test.pos[2], test.len[2])# From: "Andy Matthews" Sent: Monday, June 07, 2010 3:32 PM To: "cf-talk" 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
Rather, that would be, if you don't want the label of the field: #mid(thestring,arFound["pos"][2],arFound["len"][2])# Cheers, Kris On Tue, Jun 8, 2010 at 11:43 AM, Kris Jones wrote: > How about something like this: > > refindnocase("Age:([^\r\n|\r|\n]*)[\r\n|\r|\n]",thestring,1,true) /> > #mid(thestring,arFound["pos"][1],arFound["len"][1])# ~| 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
How about something like this: #mid(thestring,arFound["pos"][1],arFound["len"][1])# 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
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 wrote: > > 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 > wrote: > > > > > 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. > > > > > > > > #mid(testString, test.pos[2], test.len[2])# > > > > > > > > From: "Andy Matthews" > > Sent: Monday, June 07, 2010 3:32 PM > > To: "cf-talk" > > 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
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 wrote: > > 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. > > > > #mid(testString, test.pos[2], test.len[2])# > > > > From: "Andy Matthews" > Sent: Monday, June 07, 2010 3:32 PM > To: "cf-talk" > 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 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 wrote: > > 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. > > > > #mid(testString, test.pos[2], test.len[2])# > > > > From: "Andy Matthews" > Sent: Monday, June 07, 2010 3:32 PM > To: "cf-talk" > 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
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. #mid(testString, test.pos[2], test.len[2])# From: "Andy Matthews" Sent: Monday, June 07, 2010 3:32 PM To: "cf-talk" 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
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. #mid(testString, test.pos[2], test.len[2])# From: "Andy Matthews" Sent: Monday, June 07, 2010 3:32 PM To: "cf-talk" 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
Assuming that those are tabs between the elements, the following will expand on Andy's suggestion. #mid(testString, test.pos[2], test.len[2])# From: "Andy Matthews" Sent: Monday, June 07, 2010 3:32 PM To: "cf-talk" 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 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
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:334344 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
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
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
> 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
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: > > ]+>', '|', 'all')> > #listfirst(cleanline, '|')# #listlast(cleanline, '|')# > > and if you do not want any html in final result (not even tag), then > use: > ]+>', '|', '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: http://localhost/statsmerged.html";> ", sStartString)> ", sTempString)> ]+>', '|', 'all')> #listFirst(cleanLine, '|')# #listLast(cleanLine, '|')# ~| 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
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: > > ]+>', '|', 'all')> > #listfirst(cleanline, '|')# #listlast(cleanline, '|')# > > and if you do not want any html in final result (not even tag), then > use: > ]+>', '|', '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: http://localhost/statsmerged.html";> ", sStartString)> ", sTempString)> ]+>', '|', 'all')> #listFirst(cleanLine, '|')# #listLast(cleanLine, '|')# ~| 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
Azadi Saryev wrote on 16 November 2009 at 17:58 > you can do it with something like this: > > ]+>', '|', 'all')> > #listfirst(cleanline, '|')# #listlast(cleanline, '|')# > > and if you do not want any html in final result (not even tag), then > use: > ]+>', '|', '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: http://localhost/statsmerged.html";> ", sStartString)> ", sTempString)> ]+>', '|', 'all')> #listFirst(cleanLine, '|')# #listLast(cleanLine, '|')# ~| 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
you can do it with something like this: ]+>', '|', 'all')> #listfirst(cleanline, '|')# #listlast(cleanline, '|')# and if you do not want any html in final result (not even tag), then use: ]+>', '|', '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: > > abc.co.nz52 36373 8155 122 > 2652 166 760471.47 MB > xyz.co.nz31 62223 443193 > 645840 6421.8 GB > blah.com31 62225 623193 > 645840 6421.9 GB > > And what I want to do is remove everything between the first td (after > the closing ) and the last td BEFORE the next tr. > > E.G. This > abc.co.nz52 36373 8155 122 > 2652 166 760471.47 MB > > becomes > > abc.co.nz 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 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
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: abc.co.nz52 36373 8155 122 2652 166 760471.47 MB xyz.co.nz31 62223 443193 645840 6421.8 GB blah.com31 62225 623193 645840 6421.9 GB And what I want to do is remove everything between the first td (after the closing ) and the last td BEFORE the next tr. E.G. This abc.co.nz52 36373 8155 122 2652 166 760471.47 MB becomes abc.co.nz 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
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: abc.co.nz52 36373 8155 122 2652 166 760471.47 MB xyz.co.nz31 62223 443193 645840 6421.8 GB blah.com31 62225 623193 645840 6421.9 GB And what I want to do is remove everything between the first td (after the closing ) and the last td BEFORE the next tr. E.G. This abc.co.nz52 36373 8155 122 2652 166 760471.47 MB becomes abc.co.nz 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:328402 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: 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?
You don't actually need a regex to put this into one easily read line: replaceList(trim(finalDesription), ',,,', ',,,') ... Or some derivative there of. Performance may differ slightly in favour of one way or another, but as much as I love regexs and I use them frequently, they're rarely easy to descipher at a glance. Gabriel -Original Message- From: Tony Bentley [mailto:t...@tonybentley.com] Sent: Friday, 14 August 2009 5:59 AM To: cf-talk Subject: Re: Regex Help - Can this be simplified? You're better off using regex-replace(){rereplace()} over replace() for more than one condition. The pipe is a way to cheat the replace function but for future string searching or replacing functions, try regex and you can even test it online here: http://www.cftopper.com/contentfiles/tools/regularExpTester.cfm >There ya go. :) Just found out you can use the pipe "|" as well. > >rereplace(string,"()+()","","all") ~| 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:325447 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?
You're better off using regex-replace(){rereplace()} over replace() for more than one condition. The pipe is a way to cheat the replace function but for future string searching or replacing functions, try regex and you can even test it online here: http://www.cftopper.com/contentfiles/tools/regularExpTester.cfm >There ya go. :) Just found out you can use the pipe "|" as well. > >rereplace(string,"()+()","","all") ~| 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:325446 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 - Can this be simplified?
There ya go. :) Just found out you can use the pipe "|" as well. -Original Message- From: Tony Bentley [mailto:t...@tonybentley.com] Sent: Thursday, August 13, 2009 2:35 PM To: cf-talk Subject: Re: Regex Help - Can this be simplified? rereplace(string,"()+()","","all") ~| 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:325444 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?
Sorry I didn't read the post very well rereplace(form.description,"()+()+()","","all") This does not replace a single with but I think it does the job. ~| 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:325443 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?
Easy there, killer. You said "A". I said "B". You didn't preface it with "in my opinion" any more than I did. I still maintain that (in my opinion), it's preferable to write more legible code. The single line may be just as easily readable for you, but you may not always be the one maintaining your code. On Thu, Aug 13, 2009 at 11:40 AM, Dave Phillips < experiencedcfdevelo...@gmail.com> wrote: > > This, of course, is completely a matter of opinion. I prefer 1 line - > faster processing, and still easy to support. Again, that's MY opinion, > and > I'm sure we have about a hundred other opinions on this list. There's no > doubt that there are many ways to accomplish something in ColdFusion. But > an alternate method should not be shot down as "not simplified" especially > when the provider of the alternate method was just trying to help. > > Dave Phillips > > -Original Message- > From: Charlie Griefer [mailto:charlie.grie...@gmail.com] > Sent: Thursday, August 13, 2009 1:29 PM > To: cf-talk > Subject: Re: Regex Help - Can this be simplified? > > > less lines != simplified :) > > A year from now, which version are you going to want to come back to when > it > needs work? The 3 line version or the 1? > > I'd prefer the 3. Easier to read. > > > ~| 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:325442 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?
rereplace(string,"()+()","","all") ~| 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:325441 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 - Can this be simplified?
This, of course, is completely a matter of opinion. I prefer 1 line - faster processing, and still easy to support. Again, that's MY opinion, and I'm sure we have about a hundred other opinions on this list. There's no doubt that there are many ways to accomplish something in ColdFusion. But an alternate method should not be shot down as "not simplified" especially when the provider of the alternate method was just trying to help. Dave Phillips -Original Message- From: Charlie Griefer [mailto:charlie.grie...@gmail.com] Sent: Thursday, August 13, 2009 1:29 PM To: cf-talk Subject: Re: Regex Help - Can this be simplified? less lines != simplified :) A year from now, which version are you going to want to come back to when it needs work? The 3 line version or the 1? I'd prefer the 3. Easier to read. ~| 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:325440 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?
Charlie, think of my problem like this. Say you had any 5 character combos you wanted to remove, for whatever reason. I'm just looking for a simpler (or so I thought) RegEx way to do this. I could loop over a list, but I thought (perhaps naively) there might be a Regex function that could accepta a list of chars and then replace any of them when a match was found. -Original Message- From: Charlie Griefer [mailto:charlie.grie...@gmail.com] Sent: Thursday, August 13, 2009 2:29 PM To: cf-talk Subject: Re: Regex Help - Can this be simplified? less lines != simplified :) A year from now, which version are you going to want to come back to when it needs work? The 3 line version or the 1? I'd prefer the 3. Easier to read. Not really sure a regex solution is warranted here. You could probably get one whipped up to find all instances of the tag combinations that you want... but not all instances are replaced with the same string. Only the first one (the ) is replaced with a single . The others are replaced with two s. Also curious about the need to replace with . I'm not a CSS guru, but I believe the two are semantically different. One (the ) is meant to contain text. The other () just meant to force a space. will give you more flexibility via CSS to style individual paragraphs. You might not have that need now, which is fine. But by replacing all elements with you're effectively giving up that flexibility forever. ~| 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:325438 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?
less lines != simplified :) A year from now, which version are you going to want to come back to when it needs work? The 3 line version or the 1? I'd prefer the 3. Easier to read. Not really sure a regex solution is warranted here. You could probably get one whipped up to find all instances of the tag combinations that you want... but not all instances are replaced with the same string. Only the first one (the ) is replaced with a single . The others are replaced with two s. Also curious about the need to replace with . I'm not a CSS guru, but I believe the two are semantically different. One (the ) is meant to contain text. The other () just meant to force a space. will give you more flexibility via CSS to style individual paragraphs. You might not have that need now, which is fine. But by replacing all elements with you're effectively giving up that flexibility forever. On Thu, Aug 13, 2009 at 11:19 AM, Dave Phillips < experiencedcfdevelo...@gmail.com> wrote: > > I'm not an expert with Regex, but you could do this: > > > replace(replace(replace(trim(form.description),"","","all")," >","","all"),"","","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? > > ", "", > "ALL")> > ", " />", "ALL")> > ", "", > "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:325437 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: ","","all"),"","","all"),"","","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? ", "", "ALL")> ", "", "ALL")> ", "", "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
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? ", "", "ALL")> ", "", "ALL")> ", "", "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:325435 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Twitter hashtag RegEx help
> You could look for hash tags without an "&" in front of it. something > like > this: (?:[^&]|^)##([a-z0-9_\-]+) > ~Mahcsig > That was close, due to the needs of the code, I had to modify it a bit but you definitely put me on the right track. In the end, I arrived at this ([^&]|^)##([a-z0-9_\-]+) as I needed the first group to return too because the RegEx was matching the preceding character whether that was a space, comma or whatever so I needed it so I could reference it in the replace. ReReplaceNoCase(arguments.tweet, "([^&]|^)##([a-z0-9_\-]+)", "\1http://twitter.com/search?q=%23\2"";>##\2", "ALL") Thanks... Paul ~| 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:325326 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Twitter hashtag RegEx help
You could look for hash tags without an "&" in front of it. something like this: (?:[^&]|^)##([a-z0-9_\-]+) ~Mahcsig On Mon, Aug 10, 2009 at 10:24 AM, Paul Vernon < paul.ver...@web-architect.co.uk> wrote: > > Ok, so I thought I'd cracked this and I have to some extent but not > completely. > > The well known hashtag RegEx I see in most Twitter examples is a variant of > this ##([a-z0-9\-_]+) > > The problem with this is that if you run it over a string that contains > HTML entities, it will recognise those HTML entities as hashtags too... > > E.g. #mytrendingtopic is a valid hashtag but this isn't. > > #mytrendingtopic *and* #39 are recognised as hashtags... > > Now, my latest crack at this is a bit more complex and looks like this: > > ##(([a-z_\-]+[0-9_\-]*[a-z0-9_\-]+)|([0-9_\-]+[a-z_\-]+[a-z0-9_\-]+)) > > Which picks out: > > 1. All hashtags starting with alpha and containing 0 or more numbers with _ > an - at any position > 2. All hashtags starting with numbers and containing 1 or more alpha with _ > an - at any position > > This RegEx works well but it's still not quite right. The problem with this > though in that if the film 2001 or 2010 we're hashtags e.g. #2001 or #2010 > then they would get missed by the RegEx. All other hashtags are recognised > just fine and HTML entities are ignored so for the most part it's better > than the original RegEx as widely used. > > I've been working on a fix for this problem and been looking at using > lookahead and lookbehind but it seems CF doesn't support all the features I > need, i.e. no negative lookbehind. > > So if anyone can improve on my current RegEx so I can pick out > #mytrendingtopic but not #39 from the above example, I'd appreciate it very, > very much... > > Paul > > > > > ~| 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:325325 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Twitter hashtag RegEx help
Ok, so I thought I'd cracked this and I have to some extent but not completely. The well known hashtag RegEx I see in most Twitter examples is a variant of this ##([a-z0-9\-_]+) The problem with this is that if you run it over a string that contains HTML entities, it will recognise those HTML entities as hashtags too... E.g. #mytrendingtopic is a valid hashtag but this isn't. #mytrendingtopic *and* #39 are recognised as hashtags... Now, my latest crack at this is a bit more complex and looks like this: ##(([a-z_\-]+[0-9_\-]*[a-z0-9_\-]+)|([0-9_\-]+[a-z_\-]+[a-z0-9_\-]+)) Which picks out: 1. All hashtags starting with alpha and containing 0 or more numbers with _ an - at any position 2. All hashtags starting with numbers and containing 1 or more alpha with _ an - at any position This RegEx works well but it's still not quite right. The problem with this though in that if the film 2001 or 2010 we're hashtags e.g. #2001 or #2010 then they would get missed by the RegEx. All other hashtags are recognised just fine and HTML entities are ignored so for the most part it's better than the original RegEx as widely used. I've been working on a fix for this problem and been looking at using lookahead and lookbehind but it seems CF doesn't support all the features I need, i.e. no negative lookbehind. So if anyone can improve on my current RegEx so I can pick out #mytrendingtopic but not #39 from the above example, I'd appreciate it very, very much... Paul ~| 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:325319 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Regex help - without a look-around
I'm trying to match if a pageID list doesn't end with: ",services.wpViewingHistory" And has a siteList with "W" in it. Here's my regex: pageIDs="[0-9a-zA-Z.,]+,*(s[^e]{1}|se[^r]{1}|ser[^v]{1}|serv[^i]{1}|servi[^c]{1}|servic[^e]{1}|service[^s]{1}|services[^\.]{1}|services\.[^w]{1}|services\.w[^p]{1}|services\.wp[^V]{1}|services\.wpV[^i]{1}|services\.wpVi[^e]{1}|services\.wpVie[^w]{1}|services\.wpView[^i]{1}|services\.wpViewi[^n]{1}|services\.wpViewin[^g]{1}|services\.wpViewing[^H]{1}|services\.wpViewingH[^i]{1}|services\.wpViewingHi[^s]{1}|services\.wpViewingHis[^t]{1}|services\.wpViewingHist[^o]{1}|services\.wpViewingHisto[^r]{1}|services\.wpViewingHistor[^y]{1})"\s{1}siteList="(W+[,A-Za-z]*|[,A-Za-z]*W+|[,A-Za-z]*W+[,A-Za-z]+)" Here's my target string: pageIDs="services.wpLayout,profile.registerpc,services.wpProgramInfo,profile.pcLogin,errors.profile.apReferrer,services.wpViewingHistory" siteList="W" It's almost there but not quite. It doesn't match this and it should: pageIDs="services.wpLayout,profile.registerpc,services.wpProgramInfo,profile.pcLogin,errors.profile.apReferrer,main.testing" siteList="W" I can't use look-around with my regex engine Thanks for any help someone could offer... Will ~| 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:325188 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
Its only for links imbedded in content. the content is editable by the site admins and once the initial script is run the admins what the ability to edit the logme codes. I modified FCKEdit to allow me to edit the codes but I need to write a script to seed the content Duane -Original Message- From: Barney Boisvert [mailto:bboisv...@gmail.com] Sent: Thursday, July 23, 2009 6:14 PM To: cf-talk Subject: Re: RegEx Help How about load jquery and do jQuery("a").click(function() { logme(jQuery(this).attr("href")); }); On Thu, Jul 23, 2009 at 2:04 PM, Duane Boudreau wrote: > > I need a little quick (hopefully) regex help. > > I have to modify all the links on a site that do not contain onclick events > > Here is the regex and sample code I have: > > > Click here for File > Click here for > File > > > ReReplaceNoCase(myContent, "()(.*?)()", "\1\2"" > onclick=""logme('\2')\3\4\5", "all") > > this works fine as long as the link doesn't already have an onclick event in > it. > > Any ideas what I need to change? > > TIA, > Duane > > > ~| 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:324906 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
How about load jquery and do jQuery("a").click(function() { logme(jQuery(this).attr("href")); }); On Thu, Jul 23, 2009 at 2:04 PM, Duane Boudreau wrote: > > I need a little quick (hopefully) regex help. > > I have to modify all the links on a site that do not contain onclick events > > Here is the regex and sample code I have: > > > Click here for File > Click here for > File > > > ReReplaceNoCase(myContent, "()(.*?)()", "\1\2"" > onclick=""logme('\2')\3\4\5", "all") > > this works fine as long as the link doesn't already have an onclick event in > it. > > Any ideas what I need to change? > > TIA, > Duane > > > ~| 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:324905 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RegEx Help
I need a little quick (hopefully) regex help. I have to modify all the links on a site that do not contain onclick events Here is the regex and sample code I have: Click here for File Click here for File ReReplaceNoCase(myContent, "()(.*?)()", "\1\2"" onclick=""logme('\2')\3\4\5", "all") this works fine as long as the link doesn't already have an onclick event in it. Any ideas what I need to change? TIA, Duane ~| 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:324904 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Need Regex help for finding and Hyperlinks words in String
Great. Glad to help. I def recommend you learn at least the basics of Regex. It's helpful in a wide range of applications. andy -Original Message- From: Mike Francisco [mailto:cfmike...@gmail.com] Sent: Friday, June 05, 2009 2:53 PM To: cf-talk Subject: RE: Need Regex help for finding and Hyperlinks words in String Thanks Andy. That is it. Actually, I did not go very far since I am not that familiar with Regex. I only knew that Regex was the right thing to use. > -Original Message- > From: Andy Matthews [mailto:li...@commadelimited.com] > Sent: Friday, June 05, 2009 12:17 PM > To: cf-talk > Subject: RE: Need Regex help for finding and Hyperlinks words in > String > > > Mike... > > > > '@([[:alnum:]]+)', '@\1', 'ALL')> > > > > Just curious...how far did you get in your own testing? > > > andy ~| 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:323214 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Need Regex help for finding and Hyperlinks words in String
Thanks Andy. That is it. Actually, I did not go very far since I am not that familiar with Regex. I only knew that Regex was the right thing to use. > -Original Message- > From: Andy Matthews [mailto:li...@commadelimited.com] > Sent: Friday, June 05, 2009 12:17 PM > To: cf-talk > Subject: RE: Need Regex help for finding and Hyperlinks words in String > > > Mike... > > > > '@([[:alnum:]]+)', '@\1', 'ALL')> > > > > Just curious...how far did you get in your own testing? > > > andy ~| 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:323213 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Need Regex help for finding and Hyperlinks words in String
Mike... @\1', 'ALL')> Just curious...how far did you get in your own testing? andy -Original Message- From: Mike Francisco [mailto:cfmike...@gmail.com] Sent: Friday, June 05, 2009 1:46 PM To: cf-talk Subject: Need Regex help for finding and Hyperlinks words in String Happy Friday everyone. I was hoping if anyone can help me with regex and a UDF. I have a string/paragraph which contains words beginning with a specific character. I'd like to find all those words and then assign a hyperlink URL to them. Example: If the string is: Lorem ipsum dolor sit amet, consectetur adipisicing. Elit @username sed do eiusmod tempor incididunt ut labore. Et dolore magnaaliqua. Id like to find (all) words beginning with @ and replace them with <a href="/profile.cfm?id=username">@username</a> I look forward to your reply. Thanks for helping. Mike ~| 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:323212 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Need Regex help for finding and Hyperlinks words in String
Happy Friday everyone. I was hoping if anyone can help me with regex and a UDF. I have a string/paragraph which contains words beginning with a specific character. I'd like to find all those words and then assign a hyperlink URL to them. Example: If the string is: Lorem ipsum dolor sit amet, consectetur adipisicing. Elit @username sed do eiusmod tempor incididunt ut labore. Et dolore magnaaliqua. Id like to find (all) words beginning with @ and replace them with @username I look forward to your reply. Thanks for helping. Mike ~| 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:323211 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...
> I'm trying to use REFind to get all of the anchor/href tags but I'm > coming up short. RegEx is not necessarily the ideal tool for this - try a DOM Parser. If you've got consistent/controlled input you can use regex, and here's a Java one that will work in most situations: ]+?\shref\s*+=\s*+["']([^"']++)["'][^>]++>(.*?) To use that with CFML, you can use my jre-utils CFC (which is GPL Free Software, rather than a $15 per server tag). Here's an example, along with a commented version of the above regex: (?xis) # Flags (above): # x = enable regex comment-mode; # i = make case-insensitive; # s = allow . to match newlines; # Main Regex: ]+? # start of tag, lazily match at least one non-> \bhref\s*+=\s*+ # match href attribute, word boundary at start, allow whitespace around = ["']([^"']++)["'] # match value of href, possessive capture contents between the quotes (note: doesn't support inverted embedded quotes) [^>]++> # rest of tag, possessively matching non-> then > (.*?) # lazily capture any tag contents # end of tag That will set Results to an array of matches, each one containing a struct with the matched string, plus an array of the groups. All make sense? ~| 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:322985 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...
On Friday 29 May 2009, Tom Jones wrote: > If I use the following regular expression in a script it works fine, I just > dont know with CF, I have not used much RE in CF yet. http://txt2re.com/ -- Helping to globally grow world-class 24/7 unique partnerships as part of the IT team of the year, '09 and '08 Tom Chiverton Developer Tel: +44 0161 618 5032 Fax: +44 0161 618 5099 tom.chiver...@halliwells.com 3 Hardman Square, Manchester, M3 3EB www.Halliwells.com This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office together with a list of those non members who are referred to as partners. We use the word partner to refer to a member of the LLP, or an employee or consultant with equivalent standing and qualifications. Regulated by the Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.Halliwells.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:322975 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...
Tom, you could try this... http://www.somedomain.com"; method="GET" result="theData"> ]*[^/]?)>", trim(theData.fileContent))> -Original Message- From: Tom Jones [mailto:tjo...@acworld.com] Sent: Friday, May 29, 2009 11:03 AM To: cf-talk Subject: Regex help... Hello, I'm trying to use cfhttp to download and parse a directory listing from one of my sites. I can download the page but the parsing is a whole different story :-). I'm trying to use REFind to get all of the anchor/href tags but I'm coming up short. If I use the following regular expression in a script it works fine, I just dont know with CF, I have not used much RE in CF yet. Thanks, tom .*?)[""'].*?>(?.*?)",rawHTTP,1,"TRUE ")> ~| 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:322974 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...
Hi, For this type of parsing, you should have a look at CF_REextract: http://customtags.internetique.com/REextract/testREextract.cfm ~| 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:322973 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Regex help...
Hello, I'm trying to use cfhttp to download and parse a directory listing from one of my sites. I can download the page but the parsing is a whole different story :-). I'm trying to use REFind to get all of the anchor/href tags but I'm coming up short. If I use the following regular expression in a script it works fine, I just dont know with CF, I have not used much RE in CF yet. Thanks, tom .*?)[""'].*?>(?.*?)",rawHTTP,1,"TRUE")> ~| 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:322972 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
>reFindNoCase runs a fair amount slower than reFind. Have you compared it against using inline case-insensitive flag, i.e: refind( '(?i)regex' , text ) Would be interesting to know if that is any faster/slower than refindnocase. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318693 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
Ok, firstly a slight semantics rant: Strong and Bold are NOT synonymous - just because the default styling for the Strong tag is bold does not mean that they are interchangeable. Now that's out of the way, onto the regex side of things - your pattern will match this: some.th...@where.ever When matching opening/closing tags, you need to ensure that they both match, like so: <(tag1|tag2|tag3)>... The \1 is a backreference to the first group in the expression - often people use these in replacements, but they work in the main expression too! Another potential bug with the expression - what about this: some.th...@where.ever To match attributes, the simple way is to do: <(tag1|tag2|tag3)[^>]+>... For the actual email expression... well, true email regex is a nightmare, but a few obvious things: - [A-Z]{2,4} is not valid - what about .museum and others. - u...@127.0.0.1 and u...@localhost are both valid formats If this is matching, rather than validating, best to just use a simple catch-all style, along the lines of: [^@ ]+\.[^@ ]...@[^@ ]+? (I'm not entirely happy with that, but too tired to come up with better. Hopefully it gives the main idea - we don't need/want to be over-specific here.) So, keeping in mind that B != STRONG, but putting all the above together, we get: <(b|strong)[^>]+>[^@ ]+\.[^@ ]...@[^@ ]+? which can be plugged into a refind/rematch as required. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318690 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
Thanks for the tips. Always helpful! I built this quickly as I only had a few minutes. I've worked with regex for a bit. Either way it looks as though any of these examples will work. Thanks, -Pat On Fri, Jan 30, 2009 at 3:49 PM, Nathan Strutz wrote: > > Pat, > > Few tips. > If you're going to say or with (|), it's a few less > chars to just do <(b|strong)>. > Instead of [a-zA-Z0-9_%+-], you can get by with [\w%+-], oh, and add a > period to one of those in case there is more than 1 in the string, then > there's no need for that extra param and possible dot you have. > reFindNoCase runs a fair amount slower than reFind. Don't ask my why, but > benchmark it yourself. > > The updated regex could look a little more like: > > <(b|strong)>[\w%+-]*\.[\w\.%+...@[\w\.-]*[a-za-z]{2,5} > > nathan strutz > [Blog and Family @ http://www.dopefly.com/] > [AZCFUG Manager @ http://www.azcfug.org/] > > > > On Fri, Jan 30, 2009 at 10:54 AM, Patrick Santora >wrote: > > > > > This pattern should account for as well now: > > > > > > refindNoCase("(|)(([A-Z0-9_%+-]*\.)+[a-z0-9_%+...@[a-z0-9.-]+\.[a-z]{2,4})(<\/b>|<\/strong>)", > > string, 1, true )/> > > > > Just amend the tag you want to wrap around the email "(|)" and > > "(<\/b>|<\/strong>)" as shown above. Pipes are the "or" operators. > > > > -Pat > > > > On Fri, Jan 30, 2009 at 8:08 AM, Dean Lawrence > wrote: > > > > > > > > Hi All, > > > > > > Can anyone help me with a particular regex patten? I am trying to find > > any > > > email address that has at least one dot in the username portion and the > > > entire email string is surrounded by bold tags? > > > > > > Thanks > > > > > > > > > > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318688 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
Pat, Few tips. If you're going to say or with (|), it's a few less chars to just do <(b|strong)>. Instead of [a-zA-Z0-9_%+-], you can get by with [\w%+-], oh, and add a period to one of those in case there is more than 1 in the string, then there's no need for that extra param and possible dot you have. reFindNoCase runs a fair amount slower than reFind. Don't ask my why, but benchmark it yourself. The updated regex could look a little more like: <(b|strong)>[\w%+-]*\.[\w\.%+...@[\w\.-]*[a-za-z]{2,5} nathan strutz [Blog and Family @ http://www.dopefly.com/] [AZCFUG Manager @ http://www.azcfug.org/] On Fri, Jan 30, 2009 at 10:54 AM, Patrick Santora wrote: > > This pattern should account for as well now: > > refindNoCase("(|)(([A-Z0-9_%+-]*\.)+[a-z0-9_%+...@[a-z0-9.-]+\.[a-z]{2,4})(<\/b>|<\/strong>)", > string, 1, true )/> > > Just amend the tag you want to wrap around the email "(|)" and > "(<\/b>|<\/strong>)" as shown above. Pipes are the "or" operators. > > -Pat > > On Fri, Jan 30, 2009 at 8:08 AM, Dean Lawrence wrote: > > > > > Hi All, > > > > Can anyone help me with a particular regex patten? I am trying to find > any > > email address that has at least one dot in the username portion and the > > entire email string is surrounded by bold tags? > > > > Thanks > > > > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318686 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
This pattern should account for as well now: |)(([A-Z0-9_%+-]*\.)+[a-z0-9_%+...@[a-z0-9.-]+\.[a-z]{2,4})(<\/b>|<\/strong>)", string, 1, true )/> Just amend the tag you want to wrap around the email "(|)" and "(<\/b>|<\/strong>)" as shown above. Pipes are the "or" operators. -Pat On Fri, Jan 30, 2009 at 8:08 AM, Dean Lawrence wrote: > > Hi All, > > Can anyone help me with a particular regex patten? I am trying to find any > email address that has at least one dot in the username portion and the > entire email string is surrounded by bold tags? > > Thanks > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318678 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
Try this: )(([A-Z0-9_%+-]*\.)+[a-z0-9_%+...@[a-z0-9.-]+\.[a-z]{2,4})(<\/b>)", string, 1, true )/> On Fri, Jan 30, 2009 at 8:08 AM, Dean Lawrence wrote: > > Hi All, > > Can anyone help me with a particular regex patten? I am trying to find any > email address that has at least one dot in the username portion and the > entire email string is surrounded by bold tags? > > Thanks > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318677 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
so like [\w]+\.[\...@[\w]+\.[\w]{2,5} That's really basic, but should be easy to understand. nathan strutz [Blog and Family @ http://www.dopefly.com/] [AZCFUG Manager @ http://www.azcfug.org/] On Fri, Jan 30, 2009 at 9:08 AM, Dean Lawrence wrote: > > Hi All, > > Can anyone help me with a particular regex patten? I am trying to find any > email address that has at least one dot in the username portion and the > entire email string is surrounded by bold tags? > > Thanks > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318668 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Regex help
Hi All, Can anyone help me with a particular regex patten? I am trying to find any email address that has at least one dot in the username portion and the entire email string is surrounded by bold tags? Thanks ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318648 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 - matching invalid xhtml
Gotcha. :) -Original Message- From: Will Tomlinson [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 03, 2008 9:04 AM To: cf-talk Subject: Re: Regex help - matching invalid xhtml >Actually, both of your examples are "invalid" according to the W3C >which states that all attributes must be quoted: >http://www.w3.org/TR/2002/REC-xhtml1-20020801/#h-4.4 The value of that variable output DOES contain quotes. I just need my regex to do what is required by my company. "Well, I need to match what's considered to be invalid at my place of work. :)" Thanks, Will ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316194 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 - matching invalid xhtml
>Actually, both of your examples are "invalid" according to the W3C which >states that all attributes must be quoted: >http://www.w3.org/TR/2002/REC-xhtml1-20020801/#h-4.4 The value of that variable output DOES contain quotes. I just need my regex to do what is required by my company. "Well, I need to match what's considered to be invalid at my place of work. :)" Thanks, Will ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316190 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 - matching invalid xhtml
Actually, both of your examples are "invalid" according to the W3C which states that all attributes must be quoted: http://www.w3.org/TR/2002/REC-xhtml1-20020801/#h-4.4 The space before the trailing /> is irrelevant, it can appear or not without penalty: http://www.w3.org/TR/2002/REC-xhtml1-20020801/#h-4.6 It is however a good idea to put a space before the /> for readability. andy -Original Message- From: Will Tomlinson [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 02, 2008 10:07 PM To: cf-talk Subject: Re: Regex help - matching invalid xhtml I guess it'd be cool if I were to use (meta|input|img) in there, to flag single tags without the trailing [space]/> Will ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316186 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 - matching invalid xhtml
NVM, of course there is eh, you can auto fix them with CF right... Dominic 2008/12/3 Dominic Watson <[EMAIL PROTECTED]>: > Any reason not to be using the XHTML parsers out there on the produced output? > > Dominic > > 2008/12/3 Will Tomlinson <[EMAIL PROTECTED]>: >> I guess it'd be cool if I were to use (meta|input|img) in there, to flag >> single tags without the trailing [space]/> >> >> Will >> >> ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316175 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4