Re: Why this regex takes so long?
>>however try plugging it in here: It gives me the same result: Timout for PHP and Python (after about 3 sec) and a result in Javascript in about 4 sec, because it happens in my computer and there is no time out. It looks like the problem is really in the regEx itself. I'll try to get another one. ~| 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:359391 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Why this regex takes so long?
Think this has something to do with the Regex itself. I stink at them; however try plugging it in here: http://regex101.com/ It returns something about catastrophic backtracking. You may want something like this: [A-Z0-9]*@ On Thu, Oct 2, 2014 at 11:51 AM, <> wrote: > > Hi, I'm having a problem with a scheduled task that chokes my server. > Its role is to analyse bounced messages. > I have been able to identify where it blocks, when analysing a line like > this one with the regex below: > "Message-id: <26823262.22036.1411993378646.JavaMail.NS4007563$@127.0.0.1>" > "[A-Za-z0-9_](\.?[A-Za-z0-9_\-]+)*@[A-Za-z0-9_\-\.]+(\.[A-Za-z]{2,6})"> > The server seems to get stuck in an infinite loop. > Actually, the problem is that the function REfind takes much too long. > > I narrowed the problem to the following code which shows that the time > taken grows exponentially with the number of characters and is anyway > abnormaly long : > > > > > > > > > >line = (#len(line)# char. = #line# >result = #result# in #time# sec. > > > And the result is: > line = (17 char. = 000$@ result = 17 in 0.055 sec. > line = (18 char. = $@ result = 18 in 0.028 sec. > line = (19 char. = 0$@ result = 19 in 0.063 sec. > line = (20 char. = 00$@ result = 20 in 0.113 sec. > line = (21 char. = 000$@ result = 21 in 0.224 sec. > line = (22 char. = $@ result = 22 in 0.447 sec. > line = (23 char. = 0$@ result = 23 in 0.902 sec. > line = (24 char. = 00$@ result = 24 in 1.787 sec. > line = (25 char. = 000$@ result = 25 in 3.574 sec. > line = (26 char. = $@ result = 26 in 7.192 sec. > > > ~| 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:359390 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Why this regex takes so long?
Hi, I'm having a problem with a scheduled task that chokes my server. Its role is to analyse bounced messages. I have been able to identify where it blocks, when analysing a line like this one with the regex below: "Message-id: <26823262.22036.1411993378646.JavaMail.NS4007563$@127.0.0.1>" The server seems to get stuck in an infinite loop. Actually, the problem is that the function REfind takes much too long. I narrowed the problem to the following code which shows that the time taken grows exponentially with the number of characters and is anyway abnormaly long : line = (#len(line)# char. = #line# result = #result# in #time# sec. And the result is: line = (17 char. = 000$@ result = 17 in 0.055 sec. line = (18 char. = $@ result = 18 in 0.028 sec. line = (19 char. = 0$@ result = 19 in 0.063 sec. line = (20 char. = 00$@ result = 20 in 0.113 sec. line = (21 char. = 000$@ result = 21 in 0.224 sec. line = (22 char. = $@ result = 22 in 0.447 sec. line = (23 char. = 0$@ result = 23 in 0.902 sec. line = (24 char. = 00$@ result = 24 in 1.787 sec. line = (25 char. = 000$@ result = 25 in 3.574 sec. line = (26 char. = $@ result = 26 in 7.192 sec. ~| 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:359388 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: protection from sql attacks with regex++
> Doing that on everything. If you're parametrizing everything on the queries then what is the concern? -Justin ~| 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:359122 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: protection from sql attacks with regex++
Doing that on everything. -Original Message- From: Robert Harrison [mailto:rob...@austin-williams.com] Sent: Friday, August 15, 2014 1:54 PM To: cf-talk Subject: RE: protection from sql attacks with regex++ Uhm... cfqueryparam Robert Harrison Director of Interactive Services Austin & Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_williams -Original Message- From: Stephens, Larry V [mailto:steph...@iu.edu] Sent: Friday, August 15, 2014 1:51 PM To: cf-talk Subject: protection from sql attacks with regex++ Using information from a Ben Nadel atricle, jsStringFormat( htmlEditFormat()) seems to be catching insertions like and escaping them. However, I have tried a number of regex routines from http://www.symantec.com/connect/articles/detection-sql-injection-and-cross-site-scripting-attacks plus another from a CF article that I can't place at the moment, to catch statements like "select * from tblX" inserted into a text field. None of them seem to work. The number of articles and pages making recommendations and giving examples is overwhelming. Can someone provide a suggestion for protecting a site in addition to what I got from Nadel and using ScriptProtect? ~| 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:359121 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: protection from sql attacks with regex++
Unless you were using evaluate (column) name inside another query somewhere I am not aware of how that could be used for an injection On Aug 15, 2014 1:51 PM, "Stephens, Larry V" wrote: > > Using information from a Ben Nadel atricle, jsStringFormat( > htmlEditFormat()) seems to be catching insertions like and escaping > them. > > However, I have tried a number of regex routines from > http://www.symantec.com/connect/articles/detection-sql-injection-and-cross-site-scripting-attacks > plus another from a CF article that I can't place at the moment, to catch > statements like "select * from tblX" inserted into a text field. None of > them seem to work. > > The number of articles and pages making recommendations and giving > examples is overwhelming. Can someone provide a suggestion for protecting a > site in addition to what I got from Nadel and using ScriptProtect? > > > > > ~| 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:359120 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: protection from sql attacks with regex++
Uhm... cfqueryparam Robert Harrison Director of Interactive Services Austin & Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_williams -Original Message- From: Stephens, Larry V [mailto:steph...@iu.edu] Sent: Friday, August 15, 2014 1:51 PM To: cf-talk Subject: protection from sql attacks with regex++ Using information from a Ben Nadel atricle, jsStringFormat( htmlEditFormat()) seems to be catching insertions like and escaping them. However, I have tried a number of regex routines from http://www.symantec.com/connect/articles/detection-sql-injection-and-cross-site-scripting-attacks plus another from a CF article that I can't place at the moment, to catch statements like "select * from tblX" inserted into a text field. None of them seem to work. The number of articles and pages making recommendations and giving examples is overwhelming. Can someone provide a suggestion for protecting a site in addition to what I got from Nadel and using ScriptProtect? ~| 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:359119 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
protection from sql attacks with regex++
Using information from a Ben Nadel atricle, jsStringFormat( htmlEditFormat()) seems to be catching insertions like and escaping them. However, I have tried a number of regex routines from http://www.symantec.com/connect/articles/detection-sql-injection-and-cross-site-scripting-attacks plus another from a CF article that I can't place at the moment, to catch statements like "select * from tblX" inserted into a text field. None of them seem to work. The number of articles and pages making recommendations and giving examples is overwhelming. Can someone provide a suggestion for protecting a site in addition to what I got from Nadel and using ScriptProtect? ~| 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:359118 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
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: Regex question
On Wed, Jul 17, 2013 at 11:15 AM, Matthew Allen wrote: > Is it possible to change the reference-link tag from a reference link tag > to a superscript as so > 1, basically getting the value of the id attribute of the > reference link tag and creating a superscript tag with the value. I'll let someone else help with regex, but my comment from the peanut gallery: This smells like something you may be able to easily do using jQuery and let the client side manage this. -Cameron -- Cameron Childress -- p: 678.637.5072 im: cameroncf facebook <http://www.facebook.com/cameroncf> | twitter<http://twitter.com/cameronc> | google+ <https://profiles.google.com/u/0/117829379451708140985> ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356216 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Regex question
I have a body of text as below: "body body body bodybodybody bodybody body body body body body body body body bodybody body body body body" Is it possible to change the reference-link tag from a reference link tag to a superscript as so 1, basically getting the value of the id attribute of the reference link tag and creating a superscript tag with the value. Many thanks, 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:356215 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: Struggling to code accents into a cfinput regex pattern
I think I just answered my own question from another post I read. I am now using this pattern="^[a-zA-Z\u00E0-\u00FC'\-\ ]{1,50}$" and it seems to do the job. ~| 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:352793 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Struggling to code accents into a cfinput regex pattern
I am still trying to code a regex pattern for my cfinput that accepts the usual accented characters you find in languages such as French. I need something that allows people to enter their names when they contain accented characters. I realize that names can be even broader than this but I am quite happy to include all of the traditional alphabet, blanks, quotes, hyphens and accented characters. What I would like to code is this: pattern="^[a-zA-ZÀ-ÿ'\-\ ]{1,50}$" But it seems that when I insert the little piece À-ÿ it fails inside the ColdFusion javascript. Is there some way I can code this in my cfinput pattern so that the regex does accept that range of accented characters? ~| 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:352791 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: How do you allow accented characters in a cfinput regex?
OK, I think I tried what you suggested--here is exactly what I did: Added this to the page: Made the cfinput: This now allows nearly anything in the field, including characters that are not valid in names, such as $ or slash. It also leaves out the {2,50} length spec. So it doesn't seem to do what I need. ~| 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:352650 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: How do you allow accented characters in a cfinput regex?
On 9/18/2012 11:05 AM, Paul Hastings wrote: > x="T� m� in ann gloine a ithe; N� chuireann s� isteach n� > amach orm."; that didn't come through so good, grab one of the "test" phrases from http://www.sustainablegis.com/unicode/ ~| 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:352649 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: How do you allow accented characters in a cfinput regex?
On 9/18/2012 7:31 AM, John Pullam wrote: > No, it started rejecting all names when I did that. I am running CF9. you're doing it wrong: x="Tá mé in ann gloine a ithe; Ní chuireann sé isteach nó amach orm."; writeoutput('reFind says: #reFind("[[:alpha:]]",x)#'); ~| 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:352648 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: How do you allow accented characters in a cfinput regex?
>did swapping [:alpha:] for \w in the regex expression work or not? if not, >what >version of cf? No, it started rejecting all names when I did that. I am running CF9. ~| 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:352647 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: How do you allow accented characters in a cfinput regex?
On 9/17/2012 9:23 PM, John Pullam wrote: > >> Did you try setlocale on the string as per previous example? not needed in this instance. did swapping [:alpha:] for \w in the regex expression work or not? if not, what version of cf? ~| 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:352646 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: How do you allow accented characters in a cfinput regex?
>Did you try setlocale on the string as per previous example? > Sorry but I'm not clear on how I would use that, so please help me understand. For background information, this is a form field coming in to a CFFORM that I am checking with CFINPUT regex validation. I don't want to force someone to use a character set for a different country, I just want my string to be checked for accented characters. Do I need a setlocale to do that? If yes, what would I do with it? What locale would I use to accept all types of accented characters? This is obviously over my head. Sorry ... ~| 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:352641 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: How do you allow accented characters in a cfinput regex?
Did you try setlocale on the string as per previous example? Regards Russ Michaels On Sep 17, 2012 3:56 AM, "John Pullam" wrote: > > When I use this pattern="^[[:alpha:]'\-\ ]{2,50}$" nothing validates. Is > that what you meant? > > ~| 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:352640 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: How do you allow accented characters in a cfinput regex?
When I use this pattern="^[[:alpha:]'\-\ ]{2,50}$" nothing validates. Is that what you meant? ~| 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:352639 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: How do you allow accented characters in a cfinput regex?
On 9/16/2012 9:45 PM, John Pullam wrote: > pattern="^[\w'\-\ ]{2,50}$" message="Please enter a valid First Name"> change \w to [:alpha:] ~| 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:352638 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: How do you allow accented characters in a cfinput regex?
Most if the stuff in that post refer to more general regex processing, not the ColdFusion implementation. When I tried his syntax, CF failed with errors because it doesn't appear to be recognized. ~| 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:352637 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: How do you allow accented characters in a cfinput regex?
John, Larry had a great post on this a while ago.. http://www.larryullman.com/forum/read.php?19,44246 Thanks, Brian On Sep 16, 2012 10:45 AM, "John Pullam" wrote: > > I've read a whole bunch and tried many things but I can't seem to get my > regex pattern to allow accented characters, which will occur in people's > names. My cfinput currently looks like this: > > validate="regex" pattern="^[\w'\-\ ]{2,50}$" message="Please enter a valid > First Name"> > > It is fine on non-accented names like John or hyphenated names but as soon > as I enter a name with accents, it posts an error. For example, Agnès. > > I've played with other versions including :alpha: and [A-Za-zÀ-ÿ'\-\ ] but > nothing seems to work correctly. > > Sure would appreciate some help on this ... what am I missing? > > ~| 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:352636 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: How do you allow accented characters in a cfinput regex?
Sorry I don't know how to do that. How do you put a string in unicode format? >http://www.regular-expressions.info/unicode.html >It is possible that cf regex doesn't support unicode, so you should perform >some basic tests to confirm that, plus make sure the string your testing is >in unicode format > >Regards >Russ Michaels >On Sep 16, 2012 3:45 PM, "John Pullam" wrote: > >> ~| 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:352635 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: How do you allow accented characters in a cfinput regex?
http://www.regular-expressions.info/unicode.html It is possible that cf regex doesn't support unicode, so you should perform some basic tests to confirm that, plus make sure the string your testing is in unicode format Regards Russ Michaels On Sep 16, 2012 3:45 PM, "John Pullam" wrote: > > I've read a whole bunch and tried many things but I can't seem to get my > regex pattern to allow accented characters, which will occur in people's > names. My cfinput currently looks like this: > > validate="regex" pattern="^[\w'\-\ ]{2,50}$" message="Please enter a valid > First Name"> > > It is fine on non-accented names like John or hyphenated names but as soon > as I enter a name with accents, it posts an error. For example, Agnès. > > I've played with other versions including :alpha: and [A-Za-zÀ-ÿ'\-\ ] but > nothing seems to work correctly. > > Sure would appreciate some help on this ... what am I missing? > > ~| 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:352629 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
How do you allow accented characters in a cfinput regex?
I've read a whole bunch and tried many things but I can't seem to get my regex pattern to allow accented characters, which will occur in people's names. My cfinput currently looks like this: It is fine on non-accented names like John or hyphenated names but as soon as I enter a name with accents, it posts an error. For example, Agnès. I've played with other versions including :alpha: and [A-Za-zÀ-ÿ'\-\ ] but nothing seems to work correctly. Sure would appreciate some help on this ... what am I missing? ~| 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:352628 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: More Complicated RegEx Replace
> This is the replace statement a regex guru gave me > to wrap a variable found in a string in a span tag. Not sure you can call them a "guru" when the only piece of regex used is a pair of parentheses which are entirely unnecessary. *shrug* Here's a simpler version that does exactly the same thing: REReplaceNoCase ( answer , search_string , '\0' , 'all' ) However, what that isn't doing is escaping potential regex metacharacters inside search_string (which could then result in unexpected behaviour). If you can't guarantee there will not be any metacharacters present, you need to do this: REReplaceNoCase ( answer , search_string.replaceAll('[$^*()+\[\]{}.?\\|]','\\$0') , '\0' , 'all' ) (Which prefixes the relevant characters with a backslash to escape them.) Anyhow, as for your actual problem, regex is not a good tool for parsing HTML (which is what you're asking to be done by excluding tag attributes from matching). What you need to do is use a HTML parsing library, such as jSoup, to isolate the text segments within HTML tags, and loop through performing your replace operation on each of those in turn (recursing down through any child tags as required). Using jSoup, this can be achieved with the textNodes() method, to access the individual segments of text and child nodes: http://jsoup.org/apidocs/org/jsoup/nodes/Element.html#textNodes() If you're unfamiliar with using JARs in CF, Ben Nadel has a post on using jSoup with CF10: http://www.bennadel.com/blog/2358-Parsing-Traversing-And-Mutating-HTML-With-ColdFusion-And-jSoup.htm ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351784 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: More Complicated RegEx Replace
I disagree with that statement. I don't have time at the moment to play with it, but you'll want to look at negative lookahead (e.g. ?!). http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0a38f-7ffb.html#WSc3ff6d0ea77859461172e0811cbec0a38f-7fee HTH On Thu, Jun 28, 2012 at 9:26 AM, <> wrote: > > I doubt you can achieve this just using regex. > Regex are great for doing things, but not for "not doing". > > ~| 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:351751 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: More Complicated RegEx Replace
I doubt you can achieve this just using regex. Regex are great for doing things, but not for "not doing". ~| 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:351750 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
More Complicated RegEx Replace
This is the replace statement a regex guru gave me to wrap a variable found in a string in a span tag. # REReplaceNoCase(answer, '(#search_string#)', '\1', 'all')# It works great, but the variable contains html and it's also replacing stuff inside of HTML tags. Example: if the string was "pool" I'm getting results like becomes pools.cfm"> or becomes pool_picture.jpg"> Is there anything I can do to EITHER NOT do the replace when it's part of an href or img src, OR UNDO the replace if it's inside an href or img src tag? Either would achieve the same results. Any help is appreciated. This is truly beyond my regex skill level. Thanks, Robert Robert Harrison Director of Interactive Services Austin & Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_wi ~| 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:351749 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFHTTP & Regex... I'm horrible at regex
So you want the XXX in the following? Total Impressions XXX Impressions What you want is (.*?) (.*?) = capture any character, zero or more times, but only as many as needed until the next part of the expression. This will capture everything until a closing . I did it this way just in case there is a value in it with brackets. If its only going to be numbers then ([0-9]+) will work. If this is not exactly what your looking for, please give some more details and I'll craft something better. On Thu, May 31, 2012 at 4:10 PM, Roger Anthony wrote: > > I'm trying to pull total impressions from the administration screens on a > Xerox printer but for the life of me can't seem to get the regex right. I'm > thinking the Less Than and Greater Than signs are what's tripping me up, but > as frustrated as I am at the moment I can't tell you for sure. > > So, without further ado.. how the heck would you parse the filecontent to > look for the variable value that is "113067" below? Thanks in advance! > > Total Impressions > 113067 > Impressions > > ~| 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:351389 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFHTTP & Regex... I'm horrible at regex
Here's a rad tool for extracting regex patterns: http://txt2re.com/ It even outputs CF code. (I't output is pretty generic, but is a good staring point and gives nice insight into how RE works.) .jonah On 5/31/12 1:10 PM, Roger Anthony wrote: > I'm trying to pull total impressions from the administration screens on a > Xerox printer but for the life of me can't seem to get the regex right. I'm > thinking the Less Than and Greater Than signs are what's tripping me up, but > as frustrated as I am at the moment I can't tell you for sure. > > So, without further ado.. how the heck would you parse the filecontent to > look for the variable value that is "113067" below? Thanks in advance! > > Total Impressions > 113067 > Impressions > > ~| 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:351388 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
CFHTTP & Regex... I'm horrible at regex
I'm trying to pull total impressions from the administration screens on a Xerox printer but for the life of me can't seem to get the regex right. I'm thinking the Less Than and Greater Than signs are what's tripping me up, but as frustrated as I am at the moment I can't tell you for sure. So, without further ado.. how the heck would you parse the filecontent to look for the variable value that is "113067" below? Thanks in advance! Total Impressions 113067 Impressions ~| 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:351387 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex for High Ascii Chars
http://cflib.org/udf/stripExtendedAscii On Wed, Apr 18, 2012 at 01:16, Che Vilnonis wrote: > > Hello all. I'm dealing with a API where some of the results are populated > with certain Ascii characters in order to get higher sorting results. For > example, some of the characters I'm finding are: &8635 or &9606 or &9658 or > &9668 or &9734 or &9835 > > Is there a regex that could remove all of these characters at once w/o > having to maintain an ever growing list of them? > > TIA, Che > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350772 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Regex for High Ascii Chars
Hello all. I'm dealing with a API where some of the results are populated with certain Ascii characters in order to get higher sorting results. For example, some of the characters I'm finding are: &8635 or &9606 or &9658 or &9668 or &9734 or &9835 Is there a regex that could remove all of these characters at once w/o having to maintain an ever growing list of them? TIA, Che ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350764 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: RegEx Question
Not only can you do it with jQuery, you /should/ do it with jQuery (or equiv). Regex is not built for HTML parsing, and there are many reasons why it wont work correctly when you try. Rather than worry about numerous edge cases, use a tool designed for the job from the start. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344746 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: RegEx Question
Thanks that's brilliant! -Original Message- From: Dominic Watson [mailto:watson.domi...@googlemail.com] Sent: Wednesday, May 18, 2011 5:42 AM To: cf-talk Subject: Re: RegEx Question Here is a very blunt regex that should match the opening tag (does not check for the lack of target="_blank": Here's a great site: http://gskinner.com/RegExr/ On 18 May 2011 02:30, Lists wrote: > > You could actually do this with jquery quite easily should you want to do it > client side. > > $('a[href*=pdf]').click(function(){ > window.open($(this).href); > }) > > > On May 17, 2011, at 5:35 PM, Duane Boudreau wrote: > >> >> Hi All, >> >> First time posting in a very long time. >> >> I'm stuck on a RegEx problem that I can't wrap my head around. I need to >> have a block of html and I need to add target="_blank" to any hyperlink that >> has a pdf link in it. Any suggestions? >> >> Here is the match string I tried so far but I don't think I'm even close. >> >> "]*href=['\\\"]( (?i:)(?:jpg|gif|doc|pdf)$*)" >> >> If anyone can point me in the right direction it would be much appreciated. >> >> TIA, >> Duane >> >> > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344675 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: RegEx Question
Here is a very blunt regex that should match the opening tag (does not check for the lack of target="_blank": Here's a great site: http://gskinner.com/RegExr/ On 18 May 2011 02:30, Lists wrote: > > You could actually do this with jquery quite easily should you want to do it > client side. > > $('a[href*=pdf]').click(function(){ > window.open($(this).href); > }) > > > On May 17, 2011, at 5:35 PM, Duane Boudreau wrote: > >> >> Hi All, >> >> First time posting in a very long time. >> >> I'm stuck on a RegEx problem that I can't wrap my head around. I need to >> have a block of html and I need to add target="_blank" to any hyperlink that >> has a pdf link in it. Any suggestions? >> >> Here is the match string I tried so far but I don't think I'm even close. >> >> "]*href=['\\\"]( (?i:)(?:jpg|gif|doc|pdf)$*)" >> >> If anyone can point me in the right direction it would be much appreciated. >> >> TIA, >> Duane >> >> > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344611 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: RegEx Question
You could actually do this with jquery quite easily should you want to do it client side. $('a[href*=pdf]').click(function(){ window.open($(this).href); }) On May 17, 2011, at 5:35 PM, Duane Boudreau wrote: > > Hi All, > > First time posting in a very long time. > > I'm stuck on a RegEx problem that I can't wrap my head around. I need to have > a block of html and I need to add target="_blank" to any hyperlink that has a > pdf link in it. Any suggestions? > > Here is the match string I tried so far but I don't think I'm even close. > > "]*href=['\\\"]( (?i:)(?:jpg|gif|doc|pdf)$*)" > > If anyone can point me in the right direction it would be much appreciated. > > TIA, > Duane > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344609 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RegEx Question
Hi All, First time posting in a very long time. I'm stuck on a RegEx problem that I can't wrap my head around. I need to have a block of html and I need to add target="_blank" to any hyperlink that has a pdf link in it. Any suggestions? Here is the match string I tried so far but I don't think I'm even close. "]*href=['\\\"]( (?i:)(?:jpg|gif|doc|pdf)$*)" If anyone can point me in the right direction it would be much appreciated. TIA, Duane ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344604 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Question
would it ignore the parens and space? will try shortly. TNX! On 4/28/2011 1:17 PM, Andy Matthews wrote: > That seems like it might do the trick: > > http://regexr.com?2tl99 > >> Could be as simple as \w{3} >> >> Would that do it (searching for 3 consecutive word characters)? >> >> -- >> Charlie Griefer >> http://charlie.griefer.com >> >> I have failed as much as I have succeeded. But I love my life. I love >> my wife. And I wish you my kind of success. >> On Thursday, April 28, 2011 at 10:10 AM, Rick Colman wrote: >>> input looks like: >>> >>> (A XXX)(B YYY)(C ZZZ) >>> >>> I need to pull out: >>> >>> XXXYYYZZZ ... >>> >>> Can somebody help? >>> >>> TNX. >>> >>> Rick. >>> >>> > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344032 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Question
That seems like it might do the trick: http://regexr.com?2tl99 > Could be as simple as \w{3} > > Would that do it (searching for 3 consecutive word characters)? > > -- > Charlie Griefer > http://charlie.griefer.com > > I have failed as much as I have succeeded. But I love my life. I love > my wife. And I wish you my kind of success. > On Thursday, April 28, 2011 at 10:10 AM, Rick Colman wrote: > > > > input looks like: > > > > (A XXX)(B YYY)(C ZZZ) > > > > I need to pull out: > > > > XXXYYYZZZ ... > > > > Can somebody help? > > > > TNX. > > > > Rick. > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344030 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex Question
Perhaps using list functions? -Original Message- From: Rick Colman [mailto:rcol...@cox.net] Sent: 28 April 2011 18:10 To: cf-talk Subject: Regex Question input looks like: (A XXX)(B YYY)(C ZZZ) I need to pull out: XXXYYYZZZ ... Can somebody help? TNX. Rick. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344027 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Question
Could be as simple as \w{3} Would that do it (searching for 3 consecutive word characters)? -- Charlie Griefer http://charlie.griefer.com I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success. On Thursday, April 28, 2011 at 10:10 AM, Rick Colman wrote: > > input looks like: > > (A XXX)(B YYY)(C ZZZ) > > I need to pull out: > > XXXYYYZZZ ... > > Can somebody help? > > TNX. > > Rick. > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344026 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Regex Question
input looks like: (A XXX)(B YYY)(C ZZZ) I need to pull out: XXXYYYZZZ ... Can somebody help? TNX. Rick. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344023 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 to strip out non-numerics but leave decimal point
Ok ... good. Thanks Nathan! On Tue, Jan 18, 2011 at 10:02 PM, Nathan Strutz wrote: > > [:digit:] seems like a lot of typing to just say \d, and why the extra > character brackets around the outside? > > I would do this: > > reReplace(str, "[^\d\.]", "", "all") > > less typing = improvement > > nathan strutz > [http://www.dopefly.com/] [http://hi.im/nathanstrutz] > > > On Tue, Jan 18, 2011 at 1:04 PM, Jason Fisher wrote: > > > > > reReplace(rc.hourlyRateInvoicedToClient, "[^[:digit:]\.]", "", "all") > > > > > > A set [] takes all the options in it as options, so escape the . with \. > > and you should be good to go. > > > > > > > > From: "Nando" > > Sent: Tuesday, January 18, 2011 2:09 PM > > To: "cf-talk" > > Subject: Regex to strip out non-numerics but leave decimal point > > > > I'm trying to strip out all non-numeric characters from some fields. The > > catch is I need the regex to leave in the decimal point, cuz these are > > rates > > that include cents. > > > > rereplace(rc.hourlyRateInvoicedToClient,'[^[:digit:]]','','all') > > > > I'm not sure how to work something like [^\.] into it. Can anyone help? > > > > Thanks, > > > > Nando > > > > > > > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:341020 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex to strip out non-numerics but leave decimal point
[:digit:] seems like a lot of typing to just say \d, and why the extra character brackets around the outside? I would do this: reReplace(str, "[^\d\.]", "", "all") less typing = improvement nathan strutz [http://www.dopefly.com/] [http://hi.im/nathanstrutz] On Tue, Jan 18, 2011 at 1:04 PM, Jason Fisher wrote: > > reReplace(rc.hourlyRateInvoicedToClient, "[^[:digit:]\.]", "", "all") > > > A set [] takes all the options in it as options, so escape the . with \. > and you should be good to go. > > > > From: "Nando" > Sent: Tuesday, January 18, 2011 2:09 PM > To: "cf-talk" > Subject: Regex to strip out non-numerics but leave decimal point > > I'm trying to strip out all non-numeric characters from some fields. The > catch is I need the regex to leave in the decimal point, cuz these are > rates > that include cents. > > rereplace(rc.hourlyRateInvoicedToClient,'[^[:digit:]]','','all') > > I'm not sure how to work something like [^\.] into it. Can anyone help? > > Thanks, > > Nando > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340987 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex to strip out non-numerics but leave decimal point
Thanks much Jason. On Tue, Jan 18, 2011 at 9:04 PM, Jason Fisher wrote: > > reReplace(rc.hourlyRateInvoicedToClient, "[^[:digit:]\.]", "", "all") > > > A set [] takes all the options in it as options, so escape the . with \. > and you should be good to go. > > > > From: "Nando" > Sent: Tuesday, January 18, 2011 2:09 PM > To: "cf-talk" > Subject: Regex to strip out non-numerics but leave decimal point > > I'm trying to strip out all non-numeric characters from some fields. The > catch is I need the regex to leave in the decimal point, cuz these are > rates > that include cents. > > rereplace(rc.hourlyRateInvoicedToClient,'[^[:digit:]]','','all') > > I'm not sure how to work something like [^\.] into it. Can anyone help? > > Thanks, > > Nando > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340985 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
re: Regex to strip out non-numerics but leave decimal point
reReplace(rc.hourlyRateInvoicedToClient, "[^[:digit:]\.]", "", "all") A set [] takes all the options in it as options, so escape the . with \. and you should be good to go. From: "Nando" Sent: Tuesday, January 18, 2011 2:09 PM To: "cf-talk" Subject: Regex to strip out non-numerics but leave decimal point I'm trying to strip out all non-numeric characters from some fields. The catch is I need the regex to leave in the decimal point, cuz these are rates that include cents. rereplace(rc.hourlyRateInvoicedToClient,'[^[:digit:]]','','all') I'm not sure how to work something like [^\.] into it. Can anyone help? Thanks, Nando ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340980 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Regex to strip out non-numerics but leave decimal point
I'm trying to strip out all non-numeric characters from some fields. The catch is I need the regex to leave in the decimal point, cuz these are rates that include cents. rereplace(rc.hourlyRateInvoicedToClient,'[^[:digit:]]','','all') I'm not sure how to work something like [^\.] into it. Can anyone help? Thanks, Nando ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340975 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Monster Regex
worked!! thank you. On 12/6/2010 1:24 PM, Jason Fisher wrote: > Ah, yep, forgot to escape the ) when I changed the outer function to > REReplace: > > > clean = reReplace(replace(reReplace(x, "\s*;\d+-\d+", "", "all"), "((", > "(", "all"), "\)\s*\)", ")", "all") > > ---- > > From: "Rick Colman" > Sent: Monday, December 06, 2010 3:55 PM > To: "cf-talk" > Subject: Re: Monster Regex > > getting malformed regular expression ")\s*)" > > thank you ! > > On 12/6/2010 12:41 PM, Jason Fisher wrote: >> Just add a space checker inside the '))', then, something like this: >> >> >> clean = reReplace(replace(reReplace(x, "\s*;\d+-\d+", "", "all"), "((", >> "(", "all"), ")\s*)", ")", "all") >> >> >> >> From: "Rick Colman" >> Sent: Monday, December 06, 2010 3:28 PM >> To: "cf-talk" >> Subject: Re: Monster Regex >> >> this mostly worked, but did not remove one of the last trailing double > )) >> results like: >> >> (T ACT) (N AAC) (D GAT) (T ACT) (A GCT) (T ACT) (M ATG) (D GAT) (H CAC) >> (L CTG) (E GAG) (K AAA) (N AAC) (E GAA) ) >> >> On 12/6/2010 11:26 AM, Jason Fisher wrote: >>> clean = replaceList(reReplace(x, "\s*;\d+-\d+", "", "all"), "((,))", >>> "(,)") >> >> > > > ~| 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:339844 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Monster Regex
Ah, yep, forgot to escape the ) when I changed the outer function to REReplace: clean = reReplace(replace(reReplace(x, "\s*;\d+-\d+", "", "all"), "((", "(", "all"), "\)\s*\)", ")", "all") From: "Rick Colman" Sent: Monday, December 06, 2010 3:55 PM To: "cf-talk" Subject: Re: Monster Regex getting malformed regular expression ")\s*)" thank you ! On 12/6/2010 12:41 PM, Jason Fisher wrote: > Just add a space checker inside the '))', then, something like this: > > > clean = reReplace(replace(reReplace(x, "\s*;\d+-\d+", "", "all"), "((", > "(", "all"), ")\s*)", ")", "all") > > > > From: "Rick Colman" > Sent: Monday, December 06, 2010 3:28 PM > To: "cf-talk" > Subject: Re: Monster Regex > > this mostly worked, but did not remove one of the last trailing double )) > > results like: > > (T ACT) (N AAC) (D GAT) (T ACT) (A GCT) (T ACT) (M ATG) (D GAT) (H CAC) > (L CTG) (E GAG) (K AAA) (N AAC) (E GAA) ) > > On 12/6/2010 11:26 AM, Jason Fisher wrote: >> clean = replaceList(reReplace(x, "\s*;\d+-\d+", "", "all"), "((,))", >> "(,)") > > > ~| 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:339843 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Monster Regex
getting malformed regular expression ")\s*)" thank you ! On 12/6/2010 12:41 PM, Jason Fisher wrote: > Just add a space checker inside the '))', then, something like this: > > > clean = reReplace(replace(reReplace(x, "\s*;\d+-\d+", "", "all"), "((", > "(", "all"), ")\s*)", ")", "all") > > ---- > > From: "Rick Colman" > Sent: Monday, December 06, 2010 3:28 PM > To: "cf-talk" > Subject: Re: Monster Regex > > this mostly worked, but did not remove one of the last trailing double )) > > results like: > > (T ACT) (N AAC) (D GAT) (T ACT) (A GCT) (T ACT) (M ATG) (D GAT) (H CAC) > (L CTG) (E GAG) (K AAA) (N AAC) (E GAA) ) > > On 12/6/2010 11:26 AM, Jason Fisher wrote: >> clean = replaceList(reReplace(x, "\s*;\d+-\d+", "", "all"), "((,))", >> "(,)") > > > ~| 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:339840 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Monster Regex
It worked in my test, but I now notice that you've got a space before the trailing parens. Try this for the second code bit: Sent with my Droid On Dec 6, 2010 1:34 PM, "Rick Colman" wrote: > > this removed the leading parent, but did not remove the ;xxx-yyy numbers > at the end of each line or the final trailing paren ) > > like > > (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) (E GAA) > ;1210-1218 ) > > On 12/6/2010 11:16 AM, Jacob Munson wrote: >> >> >> >> >> On Mon, Dec 6, 2010 at 12:03 PM, Rick Colman wrote: >>> Been whacking at this one for a while, and it eludes me. >>> >>> ((T ACC) (I ATT) (T ACT) (P CCA) (E GAA) (T ACT) (S TCC) (R CGT) (P CCA) >>> (I ATC) ;0-9 >>> (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) (E GAA) >>> ;1210-1218) >>> >>> remove only single leading paren ( >>> remove only trailing single paren ) >>> leave all others >>> >>> remove ;xxx-yyy at the end of each line (unix line) where xxx is a >>> number and yyy is a number >>> >>> so that the result looks like: >>> >>> (T ACC) (I ATT) (T ACT) (P CCA) (E GAA) (T ACT) (S TCC) (R CGT) (P CCA) >>> (I ATC) (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) >>> (E GAA) >>> >>> You will advance the state of genomic science !!! >>> >>> (yuck ... I hate RE ...) >>> >>> Rick >>> >>> >>> >> > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339838 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Monster Regex
Just add a space checker inside the '))', then, something like this: clean = reReplace(replace(reReplace(x, "\s*;\d+-\d+", "", "all"), "((", "(", "all"), ")\s*)", ")", "all") ---- From: "Rick Colman" Sent: Monday, December 06, 2010 3:28 PM To: "cf-talk" Subject: Re: Monster Regex this mostly worked, but did not remove one of the last trailing double )) results like: (T ACT) (N AAC) (D GAT) (T ACT) (A GCT) (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) (E GAA) ) On 12/6/2010 11:26 AM, Jason Fisher wrote: > clean = replaceList(reReplace(x, "\s*;\d+-\d+", "", "all"), "((,))", > "(,)") ~| 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:339837 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Monster Regex
this removed the leading parent, but did not remove the ;xxx-yyy numbers at the end of each line or the final trailing paren ) like (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) (E GAA) ;1210-1218 ) On 12/6/2010 11:16 AM, Jacob Munson wrote: > > > > > On Mon, Dec 6, 2010 at 12:03 PM, Rick Colman wrote: >> Been whacking at this one for a while, and it eludes me. >> >> ((T ACC) (I ATT) (T ACT) (P CCA) (E GAA) (T ACT) (S TCC) (R CGT) (P CCA) >> (I ATC) ;0-9 >> (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) (E GAA) >> ;1210-1218) >> >> remove only single leading paren ( >> remove only trailing single paren ) >> leave all others >> >> remove ;xxx-yyy at the end of each line (unix line) where xxx is a >> number and yyy is a number >> >> so that the result looks like: >> >> (T ACC) (I ATT) (T ACT) (P CCA) (E GAA) (T ACT) (S TCC) (R CGT) (P CCA) >> (I ATC) (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) >> (E GAA) >> >> You will advance the state of genomic science !!! >> >> (yuck ... I hate RE ...) >> >> Rick >> >> >> > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339835 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Monster Regex
this mostly worked, but did not remove one of the last trailing double )) results like: (T ACT) (N AAC) (D GAT) (T ACT) (A GCT) (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) (E GAA) ) On 12/6/2010 11:26 AM, Jason Fisher wrote: > clean = replaceList(reReplace(x, "\s*;\d+-\d+", "", "all"), "((,))", > "(,)") ~| 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:339834 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
re: Monster Regex
Try this, where x is your original string: clean = replaceList(reReplace(x, "\s*;\d+-\d+", "", "all"), "((,))", "(,)") From: "Rick Colman" Sent: Monday, December 06, 2010 2:04 PM To: "cf-talk" Subject: Monster Regex Been whacking at this one for a while, and it eludes me. ((T ACC) (I ATT) (T ACT) (P CCA) (E GAA) (T ACT) (S TCC) (R CGT) (P CCA) (I ATC) ;0-9 (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) (E GAA) ;1210-1218) remove only single leading paren ( remove only trailing single paren ) leave all others remove ;xxx-yyy at the end of each line (unix line) where xxx is a number and yyy is a number so that the result looks like: (T ACC) (I ATT) (T ACT) (P CCA) (E GAA) (T ACT) (S TCC) (R CGT) (P CCA) (I ATC) (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) (E GAA) You will advance the state of genomic science !!! (yuck ... I hate RE ...) Rick ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339829 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Monster Regex
On Mon, Dec 6, 2010 at 12:03 PM, Rick Colman wrote: > > Been whacking at this one for a while, and it eludes me. > > ((T ACC) (I ATT) (T ACT) (P CCA) (E GAA) (T ACT) (S TCC) (R CGT) (P CCA) > (I ATC) ;0-9 > (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) (E GAA) > ;1210-1218) > > remove only single leading paren ( > remove only trailing single paren ) > leave all others > > remove ;xxx-yyy at the end of each line (unix line) where xxx is a > number and yyy is a number > > so that the result looks like: > > (T ACC) (I ATT) (T ACT) (P CCA) (E GAA) (T ACT) (S TCC) (R CGT) (P CCA) > (I ATC) (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) > (E GAA) > > You will advance the state of genomic science !!! > > (yuck ... I hate RE ...) > > Rick > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339826 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Monster Regex
Been whacking at this one for a while, and it eludes me. ((T ACC) (I ATT) (T ACT) (P CCA) (E GAA) (T ACT) (S TCC) (R CGT) (P CCA) (I ATC) ;0-9 (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) (E GAA) ;1210-1218) remove only single leading paren ( remove only trailing single paren ) leave all others remove ;xxx-yyy at the end of each line (unix line) where xxx is a number and yyy is a number so that the result looks like: (T ACC) (I ATT) (T ACT) (P CCA) (E GAA) (T ACT) (S TCC) (R CGT) (P CCA) (I ATC) (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) (E GAA) You will advance the state of genomic science !!! (yuck ... I hate RE ...) Rick ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339824 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex Question
Yep, that'll work. Of course, listGetAt(cgi.path_info, 1, "/") is the same as listFirst(cgi.path_info, "/"), so just passing the integer is a nice solution: returnVar = listGetAt(arguments.path_info, arguments.index, "/"); From: "Robert Harrison" Sent: Friday, December 03, 2010 1:03 PM To: "cf-talk" Subject: RE: Regex Question > listGetAt(cgi.path_info, 2, "/") Great. That will work for what I want. I want to be able to pass the cgi.path_info to a CFC and pass a digit so the CFC could extract the part of the string I want to do a query... I'm using long URLs to pass variables more and more these days, as opposed to ?bin=1&item=2&part=3. Thanks Robert B. Harrison Director of Interactive Services Austin & Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be &. Plug in to our blog: A&W Unplugged http://www.austin-williams.com/unplugged ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339762 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex Question
> listGetAt(cgi.path_info, 2, "/") Great. That will work for what I want. I want to be able to pass the cgi.path_info to a CFC and pass a digit so the CFC could extract the part of the string I want to do a query... I'm using long URLs to pass variables more and more these days, as opposed to ?bin=1&item=2&part=3. Thanks Robert B. Harrison Director of Interactive Services Austin & Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be &. Plug in to our blog: A&W Unplugged http://www.austin-williams.com/unplugged ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339761 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Question
Agreed. /item1/option2/part3/section4 item = #listFirst(cgi.path_info, "/")# option = #listGetAt(cgi.path_info, 2, "/")# part = #listGetAt(cgi.path_info, 3, "/")# section = #listLast(cgi.path_info, "/")# From: "Carl Von Stetten" Sent: Friday, December 03, 2010 12:36 PM To: "cf-talk" Subject: Re: Regex Question Robert, How about treating CGI.path_info as a list, using "/" as your delimiter. Then you can use the various list* functions in CF to parse it however you want. Carl On 12/3/2010 9:26 AM, Robert Harrison wrote: > Regex is not my strong suit, but someone may know this off the top of their head. If I have a long url like: > > http://www.mysite.com/item1/option2/part3/section4 > > I can use cgi.path_info to get the /item1/option2/part3/section4 part of the string. > > Now is there an easy regex that could let me get the > > item1 > option2 > part3 > section4 > > parts of the string easily? > > I'd assume there could just be one regex statement where you could just change the number(s) to get data from first / to second /; data from second / to third /, etc. > > Any ideas? > > Thanks > > Robert B. Harrison > Director of Interactive Services > Austin& Williams > 125 Kennedy Drive, Suite 100 > Hauppauge NY 11788 > P : 631.231.6600 Ext. 119 > F : 631.434.7022 > http://www.austin-williams.com > > Great advertising can't be either/or. It must be&. > > Plug in to our blog: A&W Unplugged > http://www.austin-williams.com/unplugged > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339760 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Regex Question
Robert, How about treating CGI.path_info as a list, using "/" as your delimiter. Then you can use the various list* functions in CF to parse it however you want. Carl On 12/3/2010 9:26 AM, Robert Harrison wrote: > Regex is not my strong suit, but someone may know this off the top of their > head. If I have a long url like: > > http://www.mysite.com/item1/option2/part3/section4 > > I can use cgi.path_info to get the /item1/option2/part3/section4 part of the > string. > > Now is there an easy regex that could let me get the > > item1 > option2 > part3 > section4 > > parts of the string easily? > > I'd assume there could just be one regex statement where you could just > change the number(s) to get data from first / to second /; data from second / > to third /, etc. > > Any ideas? > > Thanks > > Robert B. Harrison > Director of Interactive Services > Austin& Williams > 125 Kennedy Drive, Suite 100 > Hauppauge NY 11788 > P : 631.231.6600 Ext. 119 > F : 631.434.7022 > http://www.austin-williams.com > > Great advertising can't be either/or. It must be&. > > Plug in to our blog: A&W Unplugged > http://www.austin-williams.com/unplugged > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339757 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Regex Question
Regex is not my strong suit, but someone may know this off the top of their head. If I have a long url like: http://www.mysite.com/item1/option2/part3/section4 I can use cgi.path_info to get the /item1/option2/part3/section4 part of the string. Now is there an easy regex that could let me get the item1 option2 part3 section4 parts of the string easily? I'd assume there could just be one regex statement where you could just change the number(s) to get data from first / to second /; data from second / to third /, etc. Any ideas? Thanks Robert B. Harrison Director of Interactive Services Austin & Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be &. Plug in to our blog: A&W Unplugged http://www.austin-williams.com/unplugged ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339756 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: REGEX hell
On Thu, Nov 25, 2010 at 10:48 AM, Peter Boughton wrote: > > To be clear, CF uses the Apache ORO library, which is different to both Perl > and Java Regex. I've found the QuickREx Eclipse plugin *invaluable* for regular expression work. It supports several different regex engines, has "libraries" of regexes... It's fantastic! :Den -- The most important part of education is proper training in the nursery. Plato ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339537 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: REGEX hell
To be clear, CF uses the Apache ORO library, which is different to both Perl and Java Regex. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339536 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: REGEX hell
In this situation, there is no real difference between lazy or greedy - because the quantified item is mutually exclusive with the next characters - i.e. "\s+" cannot match "\)" - so it will always consume to the end of the whitespace. It is better to not assume lazy or greedy as a 'default' and always decide which one makes sense for the current scenario. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339535 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: REGEX hell
... since we're throwing out recommendations for our favorite "so glad this exists because of how badly I suck at reg ex" apps, I've found http://gskinner.com/RegExr/desktop/ to be a -very- valuable tool. On Thu, Nov 25, 2010 at 8:56 AM, Dave Merrill wrote: > > Be a little careful, Regex Coach works with perl regex syntax; cf > needs java syntax usually, with some differences. > > I can't recommend Regex Buddy highly enough. It's not free, but it's > really quite excellent, supports a variety of different flavors. > > Dave > > > On Thu, Nov 25, 2010 at 10:17 AM, Jerry Barnes > wrote: > > > > Regex that is useful but unfortunately, my skills are pretty weak in that > > area. > > > > I use an application named "The Regex Coach' to build my code. It has a > > place to put the string you are trying to match and another place to put > > your regex code. As you modify the regex code, it highlights how much of > > the string matches. > > > > The program is free with the option of donating via paypal to the creator > if > > you like it. > > > > > > > > J > > > > - > > > > No man's life, liberty, or property is safe while the legislature is in > > session. - Mark Twain > > > > > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339533 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: REGEX hell
Be a little careful, Regex Coach works with perl regex syntax; cf needs java syntax usually, with some differences. I can't recommend Regex Buddy highly enough. It's not free, but it's really quite excellent, supports a variety of different flavors. Dave On Thu, Nov 25, 2010 at 10:17 AM, Jerry Barnes wrote: > > Regex that is useful but unfortunately, my skills are pretty weak in that > area. > > I use an application named "The Regex Coach' to build my code. It has a > place to put the string you are trying to match and another place to put > your regex code. As you modify the regex code, it highlights how much of > the string matches. > > The program is free with the option of donating via paypal to the creator if > you like it. > > > > J > > - > > No man's life, liberty, or property is safe while the legislature is in > session. - Mark Twain > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339532 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: REGEX hell
Regex that is useful but unfortunately, my skills are pretty weak in that area. I use an application named "The Regex Coach' to build my code. It has a place to put the string you are trying to match and another place to put your regex code. As you modify the regex code, it highlights how much of the string matches. The program is free with the option of donating via paypal to the creator if you like it. J - No man's life, liberty, or property is safe while the legislature is in session. - Mark Twain ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339530 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: REGEX hell
I agree that the * (0 or more) should be avoided unless needed but in this case I felt it was. There may or may not be a space. There may be more than one space. There may be a space character being seen as a space (like a tab). Because we don't know if a space will actually exist, the * is needed. The +? (1 or more but as few as needed) assumes that at least one space exists. As a rule I don't over-worry about using * when it's used with a \s (space) unless I really have to. On Tue, Nov 23, 2010 at 12:20 AM, andy matthews wrote: > > For future reference you should avoid using * where possible as it can > easily lead to overmatching. Even using + would be better although both + > and * alone are greedy matches. An even better solution would be to use a > lazy match like so: > > \)\s+?\) > > The ? following the + tells the regex engine to match as little as > possible. > > > > andy > > -Original Message- > From: Rick Colman [mailto:rcol...@cox.net] > Sent: Monday, November 22, 2010 9:59 PM > To: cf-talk > Subject: Re: REGEX hell > > > This worked!! TNX. > > On 11/22/2010 6:04 PM, Michael Dinowitz wrote: > > Are you sure it's a space and not 2 spaces? Or a tab? Try using \s* to > > indicate that there may be one or more space characters. > > > > \)\s*\) > > > > > > > > On Mon, Nov 22, 2010 at 8:48 PM, Rick Colman wrote: > > > >> I am trying to replace two trailing parens )) with a single paren. > >> > >> here is a sample string: > >> > >> (K AAA) (N AAC) (E GAA) ) > >> > >> looks like there is a space in between the two )), so I tried: > >> > >> > >> > >> but this is not working. > >> > >> Any ideas as two what is wrong greatly appreciated. > >> > >> > >> > > > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339446 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: REGEX hell
For future reference you should avoid using * where possible as it can easily lead to overmatching. Even using + would be better although both + and * alone are greedy matches. An even better solution would be to use a lazy match like so: \)\s+?\) The ? following the + tells the regex engine to match as little as possible. andy -Original Message- From: Rick Colman [mailto:rcol...@cox.net] Sent: Monday, November 22, 2010 9:59 PM To: cf-talk Subject: Re: REGEX hell This worked!! TNX. On 11/22/2010 6:04 PM, Michael Dinowitz wrote: > Are you sure it's a space and not 2 spaces? Or a tab? Try using \s* to > indicate that there may be one or more space characters. > > \)\s*\) > > > > On Mon, Nov 22, 2010 at 8:48 PM, Rick Colman wrote: > >> I am trying to replace two trailing parens )) with a single paren. >> >> here is a sample string: >> >> (K AAA) (N AAC) (E GAA) ) >> >> looks like there is a space in between the two )), so I tried: >> >> >> >> but this is not working. >> >> Any ideas as two what is wrong greatly appreciated. >> >> >> > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339445 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: REGEX hell
This worked!! TNX. On 11/22/2010 6:04 PM, Michael Dinowitz wrote: > Are you sure it's a space and not 2 spaces? Or a tab? Try using \s* to > indicate that there may be one or more space characters. > > \)\s*\) > > > > On Mon, Nov 22, 2010 at 8:48 PM, Rick Colman wrote: > >> I am trying to replace two trailing parens )) with a single paren. >> >> here is a sample string: >> >> (K AAA) (N AAC) (E GAA) ) >> >> looks like there is a space in between the two )), so I tried: >> >> >> >> but this is not working. >> >> Any ideas as two what is wrong greatly appreciated. >> >> >> > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339444 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: REGEX hell
Are you sure it's a space and not 2 spaces? Or a tab? Try using \s* to indicate that there may be one or more space characters. \)\s*\) On Mon, Nov 22, 2010 at 8:48 PM, Rick Colman wrote: > > I am trying to replace two trailing parens )) with a single paren. > > here is a sample string: > > (K AAA) (N AAC) (E GAA) ) > > looks like there is a space in between the two )), so I tried: > > > > but this is not working. > > Any ideas as two what is wrong greatly appreciated. > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339443 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: REGEX hell
no need to escape the space char with a slash. are you sure it is only 1 space, and are you sure it is a space char (chr(32))? If so, remove the slash in front of the space, and it should work. also, pet peeve, no need for the ## around the function. Works either way, though, so ignore if you prefer. Jerry Milo Johnson On Mon, Nov 22, 2010 at 8:48 PM, Rick Colman wrote: > > I am trying to replace two trailing parens )) with a single paren. > > here is a sample string: > > (K AAA) (N AAC) (E GAA) ) > > looks like there is a space in between the two )), so I tried: > > > > but this is not working. > > Any ideas as two what is wrong greatly appreciated. > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339442 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
REGEX hell
I am trying to replace two trailing parens )) with a single paren. here is a sample string: (K AAA) (N AAC) (E GAA) ) looks like there is a space in between the two )), so I tried: but this is not working. Any ideas as two what is wrong greatly appreciated. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339441 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Regex to parse cfhttp.filecontent?
http://regexr.com?2sg59 In CF, that would return an array with one or more matches. You could then just remove the part you don't want, namely "AUTHORIZATION RESULT: ", and proceed with your string. andy -Original Message- From: Marie Taylore [mailto:mt4yl...@yahoo.com] Sent: Thursday, November 04, 2010 6:51 PM To: cf-talk Subject: Regex to parse cfhttp.filecontent? Hi all, I need help in parsing returned cfhttp.filecontent contents. I need to find the line with "AUTHORIZATION RESULT: " and then get all the text that follows on that same line. I'm sure there's a simple way to do that with ReFind, but I'm a Regex idiot. Any help would be appreciated. Thanks! MarieT ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338837 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Regex to parse cfhttp.filecontent?
Hi all, I need help in parsing returned cfhttp.filecontent contents. I need to find the line with "AUTHORIZATION RESULT: " and then get all the text that follows on that same line. I'm sure there's a simple way to do that with ReFind, but I'm a Regex idiot. Any help would be appreciated. Thanks! MarieT ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338836 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: HELP!!! REgEx, XML and a Qutation Mark
> I am trying to export our product list to an XML feed. It > works pretty well except that one of the products, has a > quotation mark in it that nothing seems to like. > It is this one right here ââ¬Â I believe that's a "fancy quote" likely pasted from Word or some other word processing application. Change the quote in the database to a standard ascii " character and the XMLFormat() should pick it up and change it to the character entity in the output (which should eliminate the need for the CDATA block as well. Alternately, if you switch the character encoding modes and the encoding of your XML file to UTF-8 all around (and the application you're importing to properly supports Unicode) then that may also allow the character to remain without error. -Justin Scott ~| 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:338779 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
HELP!!! REgEx, XML and a Qutation Mark
I am trying to export our product list to an XML feed. It works pretty well except that one of the products, has a quotation mark in it that nothing seems to like. I believe it is a cut and past issue and that the quotation mark is a special character. It is this one right here â No matter what I do I cannot get rid of this thing. And if I do search in the resulting file, I cannot search for a " because it is not the same. I am doing this, and that is not getting rid of it... â","","ALL") /> and I am wrapping the tag like this... What else can I do, besides go into the database and delete it. I would like a code solution. Thanks in advance. ~| 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:338778 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Quick Regex Question
unsubscribe In a message dated 10/29/2010 10:41:43 A.M. Eastern Daylight Time, rob...@austin-williams.com writes: I have the regex statement - ReReplace(new_dir,"\W","","all") That removes all non-alphanumeric characters from a sting. If I want to remove all non-alphanumeric characters except the underscore, is that: ReReplace(new_dir,"\W/_","","all") or ? 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 ~| 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:338687 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Quick Regex Question
Robert, Actually, the underscore is counted as an alphanumeric in regular expressions. Try just replacing \W with nothing and see what you get. nathan strutz [http://www.dopefly.com/] [http://hi.im/nathanstrutz] On Fri, Oct 29, 2010 at 7:41 AM, Robert Harrison wrote: > > I have the regex statement - ReReplace(new_dir,"\W","","all") > > That removes all non-alphanumeric characters from a sting. > > If I want to remove all non-alphanumeric characters except the underscore, > is that:ReReplace(new_dir,"\W/_","","all") or ? > > 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 > > > > > ~| 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:338671 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
NEVER MIND: Quick Regex Question
- ReReplace(new_dir,"\W","","all") is any alphanumeric character and the _ Never Mind. 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 ~| 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:338670 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Quick Regex Question
I have the regex statement - ReReplace(new_dir,"\W","","all") That removes all non-alphanumeric characters from a sting. If I want to remove all non-alphanumeric characters except the underscore, is that:ReReplace(new_dir,"\W/_","","all") or ? 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 ~| 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:338669 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: RegEx: Grabbing Keywords from Referers
Thanks for the update Peter. -Original Message- From: Peter Boughton [mailto:bought...@gmail.com] Sent: Tuesday, August 24, 2010 4:58 AM To: cf-talk Subject: Re: RegEx: Grabbing Keywords from Referers > This is incorrect - the | is a literal in character classes. You want [?&][pq]=[^&]+ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336491 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: RegEx: Grabbing Keywords from Referers
> This is incorrect - the | is a literal in character classes. You want [?&][pq]=[^&]+ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336489 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm