RE: Regex help maybe

2014-07-22 Thread UXB

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

2014-07-21 Thread Duane Boudreau

Can't really help you with the regex, but regexlib.com might help you with 
future ones. I use it whenever I need a regular expressions

-Original Message-
From: UXB [mailto:denn...@uxbinternet.com] 
Sent: Monday, July 21, 2014 6:30 PM
To: cf-talk
Subject: Regex help maybe


I am terrible at Regex's. I looked all over and am going blind.  Is there 
anyone here that can shorted my search?  I need one to test true for:

10 to 20 Characters in length
3 numeric characters in any order
1 special character from basic list ~!@#$%^*()_+


Any help is appreciated.


Dennis Powers
UXB Internet - A website Design and Hosting Company P.O. Box 6028, Wolcott, CT 
06716 - T:203-879-2844
W: http://www.uxbinternet.com
W: http://www.ctbusinesslist.com






~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358938
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Regex help maybe

2014-07-21 Thread Michael Dinowitz

X{10,20} means that X should exist at least 10 times but no more than 20
times
[0-9] means any single number from 0 till 9
[0-9]{3} means any 3 numbers of 0-9 one after the other
[~!@#$%^*()_+] means a single character from the set of characters defined
between the brackets

Now do you want 3 numbers one after the other or that there should be 3
numbers in the string total? Can you send a few example strings or talk
about how it will be used? Also, do you want a single regex to do it all or
can be it be in 2-3 steps (easiest)?



On Mon, Jul 21, 2014 at 5:29 PM, UXB denn...@uxbinternet.com wrote:


 I am terrible at Regex's. I looked all over and am going blind.  Is there
 anyone here that can shorted my search?  I need one to test true for:

 10 to 20 Characters in length
 3 numeric characters in any order
 1 special character from basic list ~!@#$%^*()_+


 Any help is appreciated.


 Dennis Powers
 UXB Internet - A website Design and Hosting Company
 P.O. Box 6028, Wolcott, CT 06716 - T:203-879-2844
 W: http://www.uxbinternet.com
 W: http://www.ctbusinesslist.com




 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358940
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Regex help maybe

2014-07-21 Thread Claude Schnéegans

 I need one to test true for:

I doubt you can do this with only one test, but using 3 tests is easy:

 10 to 20 Characters in length
 3 numeric characters in any order
 1 special character from basic list ~!@#$%^*()_+

This should do it:
CFSET stringOK = (len(form.text) GTE 20 AND len(form.text) LTE 30
   AND arrayLen(ReMatch (\d, form.text)) EQ 3
   AND arrayLen(ReMatch ([~!@##$%^*()_+], form.text)) EQ 1)

Adjust the logical operator depending what ou need is at least or exactly.


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358944
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Regex help maybe

2014-07-21 Thread Byron Mann

This would do one special, 3 consecutive numbers: ajfds123jdfs#

^(?=.*\d{3})(?=.*[\~\!\@\#\$\%\^\\*\(\)\_\+]+).{10,20}$

This would do one special, 3 numbers any position: a#bcdef2k3#4^

^(?=.*\d.*\d.*\d)(?=.*[\~\!\@\#\$\%\^\\*\(\)\_\+]+).{10,20}$

And if your restricting to just numbers and the special chars outline,
replace the last . in either to this.

[\d\~\!\@\#\$\%\^\\*\(\)\_\+]

So like this in the second variant:

^(?=.*\d.*\d.*\d)(?=.*[\~\!\@\#\$\%\^\\*\(\)\_\+]+)[\d\~\!\@\#\$\%\^\\*\(\)\_\+]{10,20}$

Plenty of online regex testers as well so you don't have to keep coding it
up to tweak.

I use this one a bit. http://regexpal.com/

Byron Mann
Lead Engineer  Architect
HostMySite







On Mon, Jul 21, 2014 at 5:29 PM, UXB denn...@uxbinternet.com wrote:


 I am terrible at Regex's. I looked all over and am going blind.  Is there
 anyone here that can shorted my search?  I need one to test true for:

 10 to 20 Characters in length
 3 numeric characters in any order
 1 special character from basic list ~!@#$%^*()_+


 Any help is appreciated.


 Dennis Powers
 UXB Internet - A website Design and Hosting Company
 P.O. Box 6028, Wolcott, CT 06716 - T:203-879-2844
 W: http://www.uxbinternet.com
 W: http://www.ctbusinesslist.com




 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358953
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Regex help needed

2011-02-14 Thread Matthew Friedman

FYI I figure it out

was simple once you looked at the content. since it is all in commented tags

ReReplaceNoCase(str,!--(.*?)--, , ALL);

Just incase anyone else has this issue.

 I am having an issue creating a regex to strip out the XML content 
 that Word 2007 is adding our HTML editor.
 we are using TINYMEC and when one of our client upgraded recently it 
 has created a large number of issues.
 
 what we need to do is to pull out the flowing content.
 
 it starts with

 !--[if gte mso 9]xmlbr/b w:WordDocumentbr/b  
 
 Ends with
 ![endif]--
 
 there is about 1000 chars between the nodes and sometimes there are 
 muliple set of nodes with the same IF and endif
 
 I was trying to create a regex to strip out this content - everything 
 from the begining to the end (I want NONE of it).
 
 if anyone has any other suggestion we are all ears here.
 Thanks - I am just not great at this regex stuff and can not get the 
 correct statement.
 
 Matt 


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342207
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Regex Help

2010-07-27 Thread Michael Grant

I hope he does because your post literally made me laugh out loud.


On Mon, Jul 26, 2010 at 8:52 PM, andy matthews li...@commadelimited.comwrote:


 You know I was kidding right?

 -Original Message-
 From: Bobby Hartsfield [mailto:bo...@acoderslife.com]
 Sent: Monday, July 26, 2010 6:21 PM
 To: cf-talk
 Subject: RE: Regex Help


 Sigh...


 .:.:.:.:.:.:.:.:.:.:.:.:.:.
 Bobby Hartsfield
 http://acoderslife.com

 -Original Message-
 From: Andy Matthews [mailto:li...@commadelimited.com]
 Sent: Monday, July 26, 2010 3:03 PM
 To: cf-talk
 Subject: RE: Regex Help


 [Completely irrelevant link removed]

 :)




 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335748
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Regex Help

2010-07-27 Thread Robert Harrison

I knew you were kidding, but I don't have time to laugh. 

I converting all my URLs from the old variable scheme (i.e., news.cfm?id=7)
to the stupid SEO spoonfeed urls (i.e.,
news.cfm/this-is-my-article-for-stupid-lazy-google-programmers-who-cant-unde
rstand-variables). 

I hate this. I now believe Google has supplanted Microsoft as the most evil
entity on the planet.


Robert B. Harrison
Director of Interactive Services
Austin  Williams
125 Kennedy Drive, Suite 100 
Hauppauge NY 11788
P : 631.231.6600 Ext. 119 
F : 631.434.7022
http://www.austin-williams.com 

Great advertising can't be either/or.  It must be .

Plug in to our blog: AW Unplugged
http://www.austin-williams.com/unplugged


-Original Message-
From: Michael Grant [mailto:mgr...@modus.bz] 
Sent: Monday, July 26, 2010 9:15 PM
To: cf-talk
Subject: Re: Regex Help


I hope he does because your post literally made me laugh out loud.


On Mon, Jul 26, 2010 at 8:52 PM, andy matthews
li...@commadelimited.comwrote:


 You know I was kidding right?

 -Original Message-
 From: Bobby Hartsfield [mailto:bo...@acoderslife.com]
 Sent: Monday, July 26, 2010 6:21 PM
 To: cf-talk
 Subject: RE: Regex Help


 Sigh...


 .:.:.:.:.:.:.:.:.:.:.:.:.:.
 Bobby Hartsfield
 http://acoderslife.com

 -Original Message-
 From: Andy Matthews [mailto:li...@commadelimited.com]
 Sent: Monday, July 26, 2010 3:03 PM
 To: cf-talk
 Subject: RE: Regex Help


 [Completely irrelevant link removed]

 :)




 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335749
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Regex Help

2010-07-27 Thread Michael Grant

Why not use url rewrite instead?
This type of thing is perfect for it, plus none of your existing links will
break.

On Tue, Jul 27, 2010 at 10:55 AM, Robert Harrison 
rob...@austin-williams.com wrote:


 I knew you were kidding, but I don't have time to laugh.

 I converting all my URLs from the old variable scheme (i.e., news.cfm?id=7)
 to the stupid SEO spoonfeed urls (i.e.,

 news.cfm/this-is-my-article-for-stupid-lazy-google-programmers-who-cant-unde
 rstand-variables).

 I hate this. I now believe Google has supplanted Microsoft as the most evil
 entity on the planet.


 Robert B. Harrison
 Director of Interactive Services
 Austin  Williams
 125 Kennedy Drive, Suite 100
 Hauppauge NY 11788
 P : 631.231.6600 Ext. 119
 F : 631.434.7022
 http://www.austin-williams.com

 Great advertising can't be either/or.  It must be .

 Plug in to our blog: AW Unplugged
 http://www.austin-williams.com/unplugged


 -Original Message-
 From: Michael Grant [mailto:mgr...@modus.bz]
 Sent: Monday, July 26, 2010 9:15 PM
 To: cf-talk
 Subject: Re: Regex Help


 I hope he does because your post literally made me laugh out loud.


 On Mon, Jul 26, 2010 at 8:52 PM, andy matthews
 li...@commadelimited.comwrote:

 
  You know I was kidding right?
 
  -Original Message-
  From: Bobby Hartsfield [mailto:bo...@acoderslife.com]
  Sent: Monday, July 26, 2010 6:21 PM
  To: cf-talk
  Subject: RE: Regex Help
 
 
  Sigh...
 
 
  .:.:.:.:.:.:.:.:.:.:.:.:.:.
  Bobby Hartsfield
  http://acoderslife.com
 
  -Original Message-
  From: Andy Matthews [mailto:li...@commadelimited.com]
  Sent: Monday, July 26, 2010 3:03 PM
  To: cf-talk
  Subject: RE: Regex Help
 
 
  [Completely irrelevant link removed]
 
  :)
 
 
 
 
 



 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335750
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Regex Help

2010-07-27 Thread Robert Harrison

 Why not use url rewrite instead? 

What's that? Have a link?



Robert B. Harrison
Director of Interactive Services
Austin  Williams
125 Kennedy Drive, Suite 100 
Hauppauge NY 11788
P : 631.231.6600 Ext. 119 
F : 631.434.7022
http://www.austin-williams.com 

Great advertising can't be either/or.  It must be .

Plug in to our blog: AW Unplugged
http://www.austin-williams.com/unplugged


 

__ Information from ESET Smart Security, version of virus signature
database 5317 (20100727) __

The message was checked by ESET Smart Security.

http://www.eset.com
 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335751
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Regex Help

2010-07-27 Thread Michael Grant

http://en.wikipedia.org/wiki/Rewrite_engine

On Tue, Jul 27, 2010 at 11:17 AM, Robert Harrison 
rob...@austin-williams.com wrote:


  Why not use url rewrite instead?

 What's that? Have a link?



 Robert B. Harrison
 Director of Interactive Services
 Austin  Williams
 125 Kennedy Drive, Suite 100
 Hauppauge NY 11788
 P : 631.231.6600 Ext. 119
 F : 631.434.7022
 http://www.austin-williams.com

 Great advertising can't be either/or.  It must be .

 Plug in to our blog: AW Unplugged
 http://www.austin-williams.com/unplugged




 __ Information from ESET Smart Security, version of virus signature
 database 5317 (20100727) __

 The message was checked by ESET Smart Security.

 http://www.eset.com


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335752
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Regex Help

2010-07-27 Thread Robert Harrison

 Why not use url rewrite instead?

If it's this:
http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/ that looks
good but it also requires server IIS intervention. That does not solve the
problem on all my sites and all the servers they are running on. Building
them into my own CMS permanently solves the problem and keeps my tools
portable for various server environments. In the long run it's I'm thinking
it's probably best to make my CMS tools just work that way so I'm not
thwarted by an uncooperative host.

Does that make since?


Robert B. Harrison
Director of Interactive Services
Austin  Williams
125 Kennedy Drive, Suite 100 
Hauppauge NY 11788
P : 631.231.6600 Ext. 119 
F : 631.434.7022
http://www.austin-williams.com 

Great advertising can't be either/or.  It must be .

Plug in to our blog: AW Unplugged
http://www.austin-williams.com/unplugged



-Original Message-
From: Robert Harrison [mailto:rob...@austin-williams.com] 
Sent: Tuesday, July 27, 2010 11:17 AM
To: cf-talk
Subject: RE: Regex Help


 Why not use url rewrite instead? 

What's that? Have a link?



Robert B. Harrison
Director of Interactive Services
Austin  Williams
125 Kennedy Drive, Suite 100 
Hauppauge NY 11788
P : 631.231.6600 Ext. 119 
F : 631.434.7022
http://www.austin-williams.com 

Great advertising can't be either/or.  It must be .

Plug in to our blog: AW Unplugged
http://www.austin-williams.com/unplugged


 

__ Information from ESET Smart Security, version of virus signature
database 5317 (20100727) __

The message was checked by ESET Smart Security.

http://www.eset.com
 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335753
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Regex Help

2010-07-27 Thread Andy Matthews

He'd still want to change all of his existing URLs so that they're correct
moving forward. However, you're right, he could use ISAPI Rewrite (IIS) or
mod_rewrite (Apache) and let the web server take care of it 

andy

-Original Message-
From: Michael Grant [mailto:mgr...@modus.bz] 
Sent: Tuesday, July 27, 2010 10:05 AM
To: cf-talk
Subject: Re: Regex Help


Why not use url rewrite instead?
This type of thing is perfect for it, plus none of your existing links will
break.

On Tue, Jul 27, 2010 at 10:55 AM, Robert Harrison 
rob...@austin-williams.com wrote:


 I knew you were kidding, but I don't have time to laugh.

 I converting all my URLs from the old variable scheme (i.e., 
 news.cfm?id=7) to the stupid SEO spoonfeed urls (i.e.,

 news.cfm/this-is-my-article-for-stupid-lazy-google-programmers-who-can
 t-unde
 rstand-variables).

 I hate this. I now believe Google has supplanted Microsoft as the most 
 evil entity on the planet.


 Robert B. Harrison
 Director of Interactive Services
 Austin  Williams
 125 Kennedy Drive, Suite 100
 Hauppauge NY 11788
 P : 631.231.6600 Ext. 119
 F : 631.434.7022
 http://www.austin-williams.com

 Great advertising can't be either/or.  It must be .

 Plug in to our blog: AW Unplugged
 http://www.austin-williams.com/unplugged


 -Original Message-
 From: Michael Grant [mailto:mgr...@modus.bz]
 Sent: Monday, July 26, 2010 9:15 PM
 To: cf-talk
 Subject: Re: Regex Help


 I hope he does because your post literally made me laugh out loud.


 On Mon, Jul 26, 2010 at 8:52 PM, andy matthews
 li...@commadelimited.comwrote:

 
  You know I was kidding right?
 
  -Original Message-
  From: Bobby Hartsfield [mailto:bo...@acoderslife.com]
  Sent: Monday, July 26, 2010 6:21 PM
  To: cf-talk
  Subject: RE: Regex Help
 
 
  Sigh...
 
 
  .:.:.:.:.:.:.:.:.:.:.:.:.:.
  Bobby Hartsfield
  http://acoderslife.com
 
  -Original Message-
  From: Andy Matthews [mailto:li...@commadelimited.com]
  Sent: Monday, July 26, 2010 3:03 PM
  To: cf-talk
  Subject: RE: Regex Help
 
 
  [Completely irrelevant link removed]
 
  :)
 
 
 
 
 



 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335754
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Regex Help

2010-07-27 Thread Andy Matthews

Fixing the  current links within your site so that they're search engine
safe will actually break ALL of your indexed links within Google, or Yahoo,
etc.

Having a URL rewrite in place alongside your code changes will allow Google
to keep your links indexed and update them the next time it indexes your
site.

My host uses ISAPI_REWRITE for IIS and here's what my .htaccess file looks
like for my blog:

RewriteEngine on
RewriteRule category/([a-zA-Z0-9-]+) index.cfm?verb=categoryterm=$1
RewriteRule search/([a-zA-Z0-9-,]+) index.cfm?verb=searchterm=$1
RewriteRule rss/([a-zA-Z0-9-,]+)? rss.cfm?feed=$1

I personally HATE having to have the index.cfm in my links so I wrote this
to keep me from having to do that. A category link might look like this:

http://andymatthews.net/category/jQuery/

What the regex does in the second line above is to capture (regex)
everything after category/ and pass it to index.cfm as
verb=categoryterm=jQuery


andy


-Original Message-
From: Robert Harrison [mailto:rob...@austin-williams.com] 
Sent: Tuesday, July 27, 2010 10:24 AM
To: cf-talk
Subject: RE: Regex Help


 Why not use url rewrite instead?

If it's this:
http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/ that looks
good but it also requires server IIS intervention. That does not solve the
problem on all my sites and all the servers they are running on. Building
them into my own CMS permanently solves the problem and keeps my tools
portable for various server environments. In the long run it's I'm thinking
it's probably best to make my CMS tools just work that way so I'm not
thwarted by an uncooperative host.

Does that make since?


Robert B. Harrison
Director of Interactive Services
Austin  Williams
125 Kennedy Drive, Suite 100
Hauppauge NY 11788
P : 631.231.6600 Ext. 119
F : 631.434.7022
http://www.austin-williams.com 

Great advertising can't be either/or.  It must be .

Plug in to our blog: AW Unplugged
http://www.austin-williams.com/unplugged



-Original Message-
From: Robert Harrison [mailto:rob...@austin-williams.com]
Sent: Tuesday, July 27, 2010 11:17 AM
To: cf-talk
Subject: RE: Regex Help


 Why not use url rewrite instead? 

What's that? Have a link?



Robert B. Harrison
Director of Interactive Services
Austin  Williams
125 Kennedy Drive, Suite 100 
Hauppauge NY 11788
P : 631.231.6600 Ext. 119 
F : 631.434.7022
http://www.austin-williams.com 

Great advertising can't be either/or.  It must be .

Plug in to our blog: AW Unplugged
http://www.austin-williams.com/unplugged


 

__ Information from ESET Smart Security, version of virus signature
database 5317 (20100727) __

The message was checked by ESET Smart Security.

http://www.eset.com
 





~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335755
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Regex Help

2010-07-27 Thread Dave Watts

 I converting all my URLs from the old variable scheme (i.e., news.cfm?id=7)
 to the stupid SEO spoonfeed urls (i.e.,
 news.cfm/this-is-my-article-for-stupid-lazy-google-programmers-who-cant-unde
 rstand-variables).

 I hate this. I now believe Google has supplanted Microsoft as the most evil
 entity on the planet.

Well, that's kind of dumb. Google didn't come out to your office and
make you rewrite your URLs, did they?

You can certainly use embedded URL parameters, and Google will still
index your pages. But Google, like regular people, can make more sense
out of URLs that themselves make more sense. This has nothing to do
with laziness, and everything to do with how URLs are meant to be
used:

http://www.w3.org/Provider/Style/URI

In general, when it comes to SEO, common sense is your best guide. And
there's a good argument to be made that implementation details should
be minimized or removed entirely from URLs.

  Why not use url rewrite instead?

 If it's this:
 http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/ that looks
 good but it also requires server IIS intervention. That does not solve the
 problem on all my sites and all the servers they are running on. Building
 them into my own CMS permanently solves the problem and keeps my tools
 portable for various server environments. In the long run it's I'm thinking
 it's probably best to make my CMS tools just work that way so I'm not
 thwarted by an uncooperative host.

Then you should be looking at this:
http://www.tuckey.org/urlrewrite/

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335757
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Regex Help

2010-07-27 Thread Robert Harrison

 Fixing the  current links within your site so that they're search engine
safe will actually break ALL of your indexed links within Google, or Yahoo,
etc.

In this case I put in a hook old so the old links still work. They do a 301
redirect to the new link schema. That should cover the search engines and
any bookmarks.

It seems to be working... http://www.austin-williams.com/news.cfm.  All the
links are now SEO 'friendly'.  

I've set it up so the CMS automatically builds the link when new records are
added. Most of the time there is no need to change that, but I've also put
in an option to 'rebuild' a link on record update. It defaults to OFF, but
it can be forced on to do it sometimes. Here's a case in point why I did
that...

One thing we build is banking sites. So they create an account and it builds
the link: http://commercialbank.com/accounts/free-checking.  That's great,
but now the CEO they can't afford to give away checking accounts anymore, so
they need to charge $2/month. So the update the account, but
http://commercialbank.com/accounts/free-checking is misleading. In this case
they need to change the link, so they have an option to rebuild to, say:
http://commercialbank.com/accounts/really-cheap-checking. 

I see no way around this. In spite of the best efforts, some links may
occasionally be lost.


Robert B. Harrison
Director of Interactive Services
Austin  Williams
125 Kennedy Drive, Suite 100 
Hauppauge NY 11788
P : 631.231.6600 Ext. 119 
F : 631.434.7022
http://www.austin-williams.com 

Great advertising can't be either/or.  It must be .

Plug in to our blog: AW Unplugged
http://www.austin-williams.com/unplugged


 

__ Information from ESET Smart Security, version of virus signature
database 5317 (20100727) __

The message was checked by ESET Smart Security.

http://www.eset.com
 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335761
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Regex Help

2010-07-27 Thread Michael Grant

Robert:

Decided I'd check out your site.

This page is messed up: http://www.austin-williams.com/people/
Barbara Espisito's mini bio is all screwy. (Ironic that she's the copy
chief.)
Looking at the source it looks like your db entry for her is mangled pretty
badly.

On another note, who took those pictures? Was it their intent to catch
everyone in the middle of an awkward expression?




On Tue, Jul 27, 2010 at 12:11 PM, Robert Harrison 
rob...@austin-williams.com wrote:


  Fixing the  current links within your site so that they're search engine
 safe will actually break ALL of your indexed links within Google, or Yahoo,
 etc.

 In this case I put in a hook old so the old links still work. They do a 301
 redirect to the new link schema. That should cover the search engines and
 any bookmarks.

 It seems to be working... http://www.austin-williams.com/news.cfm.  All
 the
 links are now SEO 'friendly'.

 I've set it up so the CMS automatically builds the link when new records
 are
 added. Most of the time there is no need to change that, but I've also put
 in an option to 'rebuild' a link on record update. It defaults to OFF, but
 it can be forced on to do it sometimes. Here's a case in point why I did
 that...

 One thing we build is banking sites. So they create an account and it
 builds
 the link: http://commercialbank.com/accounts/free-checking.  That's great,
 but now the CEO they can't afford to give away checking accounts anymore,
 so
 they need to charge $2/month. So the update the account, but
 http://commercialbank.com/accounts/free-checking is misleading. In this
 case
 they need to change the link, so they have an option to rebuild to, say:
 http://commercialbank.com/accounts/really-cheap-checking.

 I see no way around this. In spite of the best efforts, some links may
 occasionally be lost.


 Robert B. Harrison
 Director of Interactive Services
 Austin  Williams
 125 Kennedy Drive, Suite 100
 Hauppauge NY 11788
 P : 631.231.6600 Ext. 119
 F : 631.434.7022
 http://www.austin-williams.com

 Great advertising can't be either/or.  It must be .

 Plug in to our blog: AW Unplugged
 http://www.austin-williams.com/unplugged




 __ Information from ESET Smart Security, version of virus signature
 database 5317 (20100727) __

 The message was checked by ESET Smart Security.

 http://www.eset.com


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335762
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Regex Help

2010-07-27 Thread Bobby Hartsfield

Absolutely... nd I thought it was pretty funny :-)
 
 
.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
 
-Original Message-
From: andy matthews [mailto:li...@commadelimited.com] 
Sent: Monday, July 26, 2010 8:52 PM
To: cf-talk
Subject: RE: Regex Help


You know I was kidding right?

-Original Message-
From: Bobby Hartsfield [mailto:bo...@acoderslife.com] 
Sent: Monday, July 26, 2010 6:21 PM
To: cf-talk
Subject: RE: Regex Help


Sigh...

 
.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
 
-Original Message-
From: Andy Matthews [mailto:li...@commadelimited.com] 
Sent: Monday, July 26, 2010 3:03 PM
To: cf-talk
Subject: RE: Regex Help


[Completely irrelevant link removed]

:)






~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335763
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Regex Help

2010-07-27 Thread Robert Harrison

Hmmm. Those pages are static and
http://www.austin-williams.com/people/barbara-esposito.cfm looks fine from
here. 

What are you seeing? What browser are you on? 

As far as the pictures, I'm the Technology Director, not the Creative
Director. That is ground on which I do not tread  :-)


Robert B. Harrison
Director of Interactive Services
Austin  Williams
125 Kennedy Drive, Suite 100 
Hauppauge NY 11788
P : 631.231.6600 Ext. 119 
F : 631.434.7022
http://www.austin-williams.com 

Great advertising can't be either/or.  It must be .

Plug in to our blog: AW Unplugged
http://www.austin-williams.com/unplugged

 

__ Information from ESET Smart Security, version of virus signature
database 5318 (20100727) __

The message was checked by ESET Smart Security.

http://www.eset.com
 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335764
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Regex Help

2010-07-27 Thread Michael Grant

It was on the link I posted. However after going to it again I see it's not
outputting the same as it was. Weird. I'm on chrome. Her text description
was displaying hundreds of little rectangles. Like when character encoding
is improper.

On Tue, Jul 27, 2010 at 12:28 PM, Robert Harrison 
rob...@austin-williams.com wrote:


 Hmmm. Those pages are static and
 http://www.austin-williams.com/people/barbara-esposito.cfm looks fine from
 here.

 What are you seeing? What browser are you on?

 As far as the pictures, I'm the Technology Director, not the Creative
 Director. That is ground on which I do not tread  :-)


 Robert B. Harrison
 Director of Interactive Services
 Austin  Williams
 125 Kennedy Drive, Suite 100
 Hauppauge NY 11788
 P : 631.231.6600 Ext. 119
 F : 631.434.7022
 http://www.austin-williams.com

 Great advertising can't be either/or.  It must be .

 Plug in to our blog: AW Unplugged
 http://www.austin-williams.com/unplugged



 __ Information from ESET Smart Security, version of virus signature
 database 5318 (20100727) __

 The message was checked by ESET Smart Security.

 http://www.eset.com


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335765
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Regex Help

2010-07-27 Thread denstar

This is neither here nor there, but the URLRewriteFilter can go on the
actual application server, thus negating the need for IIS or Apache
intervention, and as an added bonus, can do outbound rules as well.

This means that you don't need to change your internal links from:
index.cfm?somevar=woohoo, and instead can do this:
getPageContext().getResponse().encode(index.cfm?somevar=woohoo) and
have the HTML href that is returned to the client look like this:
/somevar/woohoo (and obviously have incoming /somevar/woohoo requests
translated to index.cfm?somevar=woohoo).

You still have to wrap stuff with the encode() deal, so it's not
super-cool if you've got a lot of links various places, but it's
probably a pretty fast way to go pretty URL style without having to
do much more than wrap your links with encode().

Just food for thought.  I'm really liking it, and it doesn't add much overhead.

I know this probably doesn't make much sense, but I can elaborate if
anyone is actually interested.  :)

:Den

-- 
There is a specter haunting Europe, the specter of Communism.
Karl Marx

On Tue, Jul 27, 2010 at 9:23 AM, Robert Harrison wrote:

 Why not use url rewrite instead?

 If it's this:
 http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/ that looks
 good but it also requires server IIS intervention. That does not solve the
 problem on all my sites and all the servers they are running on. Building
 them into my own CMS permanently solves the problem and keeps my tools
 portable for various server environments. In the long run it's I'm thinking
 it's probably best to make my CMS tools just work that way so I'm not
 thwarted by an uncooperative host.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335772
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Regex Help

2010-07-26 Thread Charlie Griefer

rereplace( myvar, '-+', '-', 'all' )

On Mon, Jul 26, 2010 at 10:59 AM, Robert Harrison 
rob...@austin-williams.com wrote:


 I want to replace any occurrence of multiple -- in string so the entire
 string only contains one - in a row after filtering.

 Something like this does (sort of):

#Replacelist(#mayvar#,-,,---,--,-,-,-,-)#

 But with regex more like:

#ReReplace(#myvar#,--,-,ALL)#

 How do I write a reg to change all multiple -- to result in only one -?

 Thanks




 Robert B. Harrison
 Director of Interactive Services
 Austin  Williams
 125 Kennedy Drive, Suite 100
 Hauppauge NY 11788
 P : 631.231.6600 Ext. 119
 F : 631.434.7022
 http://www.austin-williams.com

 Great advertising can't be either/or.  It must be .

 Plug in to our blog: AW Unplugged
 http://www.austin-williams.com/unplugged





 __ Information from ESET Smart Security, version of virus signature
 database 5315 (20100726) __

 The message was checked by ESET Smart Security.

 http://www.eset.com


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335720
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Regex Help

2010-07-26 Thread Michael Grant

OT: Isn't regex elegant? Often very cryptic but any solution where I've used
regex seems both sophisticated and simple.

As you were.


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335721
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Regex Help

2010-07-26 Thread Robert Harrison

Thanks... I just could not get that straight. 


Robert B. Harrison
Director of Interactive Services
Austin  Williams
125 Kennedy Drive, Suite 100 
Hauppauge NY 11788
P : 631.231.6600 Ext. 119 
F : 631.434.7022
http://www.austin-williams.com 

Great advertising can't be either/or.  It must be .

Plug in to our blog: AW Unplugged
http://www.austin-williams.com/unplugged



-Original Message-
From: Charlie Griefer [mailto:charlie.grie...@gmail.com] 
Sent: Monday, July 26, 2010 2:04 PM
To: cf-talk
Subject: Re: Regex Help


rereplace( myvar, '-+', '-', 'all' )

On Mon, Jul 26, 2010 at 10:59 AM, Robert Harrison 
rob...@austin-williams.com wrote:


 I want to replace any occurrence of multiple -- in string so the entire
 string only contains one - in a row after filtering.

 Something like this does (sort of):

#Replacelist(#mayvar#,-,,---,--,-,-,-,-)#

 But with regex more like:

#ReReplace(#myvar#,--,-,ALL)#

 How do I write a reg to change all multiple -- to result in only one -?

 Thanks




 Robert B. Harrison
 Director of Interactive Services
 Austin  Williams
 125 Kennedy Drive, Suite 100
 Hauppauge NY 11788
 P : 631.231.6600 Ext. 119
 F : 631.434.7022
 http://www.austin-williams.com

 Great advertising can't be either/or.  It must be .

 Plug in to our blog: AW Unplugged
 http://www.austin-williams.com/unplugged





 __ Information from ESET Smart Security, version of virus
signature
 database 5315 (20100726) __

 The message was checked by ESET Smart Security.

 http://www.eset.com


 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335722
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Regex Help

2010-07-26 Thread Andy Matthews

http://www.cftagstore.com/tags/cfreextract.cfm

:) 

-Original Message-
From: Robert Harrison [mailto:rob...@austin-williams.com] 
Sent: Monday, July 26, 2010 1:00 PM
To: cf-talk
Subject: Regex Help


I want to replace any occurrence of multiple -- in string so the entire
string only contains one - in a row after filtering.

Something like this does (sort of):

#Replacelist(#mayvar#,-,,---,--,-,-,-,-)#

But with regex more like:

#ReReplace(#myvar#,--,-,ALL)#

How do I write a reg to change all multiple -- to result in only one -?

Thanks




Robert B. Harrison
Director of Interactive Services
Austin  Williams
125 Kennedy Drive, Suite 100
Hauppauge NY 11788
P : 631.231.6600 Ext. 119
F : 631.434.7022
http://www.austin-williams.com 

Great advertising can't be either/or.  It must be .

Plug in to our blog: AW Unplugged
http://www.austin-williams.com/unplugged



 

__ Information from ESET Smart Security, version of virus signature
database 5315 (20100726) __

The message was checked by ESET Smart Security.

http://www.eset.com
 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335723
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Regex Help

2010-07-26 Thread Charlie Griefer

troublemaker :D

On Mon, Jul 26, 2010 at 12:02 PM, Andy Matthews li...@commadelimited.comwrote:


 http://www.cftagstore.com/tags/cfreextract.cfm

 :)

 -Original Message-
 From: Robert Harrison [mailto:rob...@austin-williams.com]
 Sent: Monday, July 26, 2010 1:00 PM
 To: cf-talk
 Subject: Regex Help


 I want to replace any occurrence of multiple -- in string so the entire
 string only contains one - in a row after filtering.

 Something like this does (sort of):

#Replacelist(#mayvar#,-,,---,--,-,-,-,-)#

 But with regex more like:

#ReReplace(#myvar#,--,-,ALL)#

 How do I write a reg to change all multiple -- to result in only one -?

 Thanks




 Robert B. Harrison
 Director of Interactive Services
 Austin  Williams
 125 Kennedy Drive, Suite 100
 Hauppauge NY 11788
 P : 631.231.6600 Ext. 119
 F : 631.434.7022
 http://www.austin-williams.com

 Great advertising can't be either/or.  It must be .

 Plug in to our blog: AW Unplugged
 http://www.austin-williams.com/unplugged





 __ Information from ESET Smart Security, version of virus signature
 database 5315 (20100726) __

 The message was checked by ESET Smart Security.

 http://www.eset.com




 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335724
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Regex Help

2010-07-26 Thread Bobby Hartsfield

Sigh...

 
.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
 
-Original Message-
From: Andy Matthews [mailto:li...@commadelimited.com] 
Sent: Monday, July 26, 2010 3:03 PM
To: cf-talk
Subject: RE: Regex Help


[Completely irrelevant link removed]

:) 

-Original Message-
From: Robert Harrison [mailto:rob...@austin-williams.com] 
Sent: Monday, July 26, 2010 1:00 PM
To: cf-talk
Subject: Regex Help


I want to replace any occurrence of multiple -- in string so the entire
string only contains one - in a row after filtering.

Something like this does (sort of):

#Replacelist(#mayvar#,-,,---,--,-,-,-,-)#

But with regex more like:

#ReReplace(#myvar#,--,-,ALL)#

How do I write a reg to change all multiple -- to result in only one -?

Thanks




Robert B. Harrison
Director of Interactive Services
Austin  Williams
125 Kennedy Drive, Suite 100
Hauppauge NY 11788
P : 631.231.6600 Ext. 119
F : 631.434.7022
http://www.austin-williams.com 

Great advertising can't be either/or.? It must be?.

Plug in to our blog:?AW Unplugged
http://www.austin-williams.com/unplugged



 

__ Information from ESET Smart Security, version of virus signature
database 5315 (20100726) __

The message was checked by ESET Smart Security.

http://www.eset.com
 





~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335738
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Regex Help

2010-07-26 Thread andy matthews

You know I was kidding right?

-Original Message-
From: Bobby Hartsfield [mailto:bo...@acoderslife.com] 
Sent: Monday, July 26, 2010 6:21 PM
To: cf-talk
Subject: RE: Regex Help


Sigh...

 
.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
 
-Original Message-
From: Andy Matthews [mailto:li...@commadelimited.com] 
Sent: Monday, July 26, 2010 3:03 PM
To: cf-talk
Subject: RE: Regex Help


[Completely irrelevant link removed]

:)




~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335742
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Regex Help

2010-07-26 Thread Dan Baughman

kidding? i already spent $15!

On Mon, Jul 26, 2010 at 6:52 PM, andy matthews li...@commadelimited.comwrote:


 You know I was kidding right?

 -Original Message-
 From: Bobby Hartsfield [mailto:bo...@acoderslife.com]
 Sent: Monday, July 26, 2010 6:21 PM
 To: cf-talk
 Subject: RE: Regex Help


 Sigh...


 .:.:.:.:.:.:.:.:.:.:.:.:.:.
 Bobby Hartsfield
 http://acoderslife.com

 -Original Message-
 From: Andy Matthews [mailto:li...@commadelimited.com]
 Sent: Monday, July 26, 2010 3:03 PM
 To: cf-talk
 Subject: RE: Regex Help


 [Completely irrelevant link removed]

 :)




 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335743
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: RegEx help

2010-06-08 Thread Debbie Morris

Thanks for the help, Jason and Andy. Turns out the character apparently isn't a 
tab though. Viewing it in WireShark, it looks like there is a carriage return 
(0d), a line feed (0a) and a space (20) between the age and gender strings.

Sorry to be so dumb, but I've managed to avoid regular expressions for the most 
part, so I'm really clueless now that I need it. I've tried reading through the 
documentation but it all seems like Greek to me. How can I test for the 
combination of those three characters?

Deb

-Original Message-
From: Jason Fisher [mailto:ja...@wanax.com] 
Sent: Monday, June 07, 2010 4:27 PM
To: cf-talk
Subject: RE: RegEx help


Assuming that those are tabs between the elements, the following will 
expand on Andy's suggestion.

cfset testString = Case Information   Problem:diff breathing   Patients:1 
  Four commandment
Information   Age:2 months   Gender:Female   Conscious:Yes   Brea /
cfset test = reFind(Age:([0-9a-zA-Z ]+)\t, testString, 1, true) /
cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput



From: Andy Matthews li...@commadelimited.com
Sent: Monday, June 07, 2010 3:32 PM
To: cf-talk cf-talk@houseoffusion.com
Subject: RE: RegEx help

If you can always depend on Age: before the desired string, and what looks
like a tab afterwards, then it's trivial:

Age:[0-9a-Z]+\t

That assumes that the age will be any combination of letters and numbers,
and also allows for upper and lower case.

andy

-Original Message-
From: Debbie Morris [mailto:ddicker...@macromedia.com] 
Sent: Monday, June 07, 2010 1:51 PM
To: cf-talk
Subject: RegEx help

I need to extract a particular piece of data from one of my query fields 
and
I'm not sure how to go about it.

We have incidents in one table that can have comments in another table
associated with them.

Here's an example of one of the comments in my query results that I need 
to
grab data from:

Case Information   Problem:diff breathing   Patients:1   Four commandment
Information   Age:2 months   Gender:Female   Conscious:Yes   Brea

I need to get the Age information for any comments that contain it. The 
Age
field always begins as shown above and the Gender field always immediately
follows it, so I'm assuming I can work from that, but I just don't know 
how
to go about writing it. Any thoughts would be greatly appreciated!!

Deb 





~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334360
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: RegEx help

2010-06-08 Thread Bobby Hartsfield

If you mean test for that exact order of those three characters, you don't
really need a regex for that. It is just a constant string.

I believe it would be 

#Chr(13)  chr(10)  ' '#

 
 
.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
 
-Original Message-
From: Debbie Morris [mailto:dmor...@sussexcountyde.gov] 
Sent: Tuesday, June 08, 2010 10:23 AM
To: cf-talk
Subject: RE: RegEx help


Thanks for the help, Jason and Andy. Turns out the character apparently
isn't a tab though. Viewing it in WireShark, it looks like there is a
carriage return (0d), a line feed (0a) and a space (20) between the age and
gender strings.

Sorry to be so dumb, but I've managed to avoid regular expressions for the
most part, so I'm really clueless now that I need it. I've tried reading
through the documentation but it all seems like Greek to me. How can I test
for the combination of those three characters?

Deb

-Original Message-
From: Jason Fisher [mailto:ja...@wanax.com] 
Sent: Monday, June 07, 2010 4:27 PM
To: cf-talk
Subject: RE: RegEx help


Assuming that those are tabs between the elements, the following will 
expand on Andy's suggestion.

cfset testString = Case Information   Problem:diff breathing   Patients:1 
  Four commandment
Information   Age:2 months   Gender:Female   Conscious:Yes   Brea /
cfset test = reFind(Age:([0-9a-zA-Z ]+)\t, testString, 1, true) /
cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput



From: Andy Matthews li...@commadelimited.com
Sent: Monday, June 07, 2010 3:32 PM
To: cf-talk cf-talk@houseoffusion.com
Subject: RE: RegEx help

If you can always depend on Age: before the desired string, and what looks
like a tab afterwards, then it's trivial:

Age:[0-9a-Z]+\t

That assumes that the age will be any combination of letters and numbers,
and also allows for upper and lower case.

andy

-Original Message-
From: Debbie Morris [mailto:ddicker...@macromedia.com] 
Sent: Monday, June 07, 2010 1:51 PM
To: cf-talk
Subject: RegEx help

I need to extract a particular piece of data from one of my query fields 
and
I'm not sure how to go about it.

We have incidents in one table that can have comments in another table
associated with them.

Here's an example of one of the comments in my query results that I need 
to
grab data from:

Case Information   Problem:diff breathing   Patients:1   Four commandment
Information   Age:2 months   Gender:Female   Conscious:Yes   Brea

I need to get the Age information for any comments that contain it. The 
Age
field always begins as shown above and the Gender field always immediately
follows it, so I'm assuming I can work from that, but I just don't know 
how
to go about writing it. Any thoughts would be greatly appreciated!!

Deb 







~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334361
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: RegEx help

2010-06-08 Thread Michael Grant

I think he wants to make it part of the t-sql code.

Do you really need to test for all three of these? Will there ever be a
carriage return in the Age value that's valid? If not why not just test for
the carriage return alone as the end part of your regex?


On Tue, Jun 8, 2010 at 11:01 AM, Bobby Hartsfield bo...@acoderslife.comwrote:


 If you mean test for that exact order of those three characters, you don't
 really need a regex for that. It is just a constant string.

 I believe it would be

 #Chr(13)  chr(10)  ' '#



 .:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
 Bobby Hartsfield
 http://acoderslife.com

 -Original Message-
 From: Debbie Morris [mailto:dmor...@sussexcountyde.gov]
 Sent: Tuesday, June 08, 2010 10:23 AM
 To: cf-talk
 Subject: RE: RegEx help


 Thanks for the help, Jason and Andy. Turns out the character apparently
 isn't a tab though. Viewing it in WireShark, it looks like there is a
 carriage return (0d), a line feed (0a) and a space (20) between the age and
 gender strings.

 Sorry to be so dumb, but I've managed to avoid regular expressions for the
 most part, so I'm really clueless now that I need it. I've tried reading
 through the documentation but it all seems like Greek to me. How can I test
 for the combination of those three characters?

 Deb

 -Original Message-
 From: Jason Fisher [mailto:ja...@wanax.com]
 Sent: Monday, June 07, 2010 4:27 PM
 To: cf-talk
 Subject: RE: RegEx help


 Assuming that those are tabs between the elements, the following will
 expand on Andy's suggestion.

 cfset testString = Case Information   Problem:diff breathing   Patients:1
  Four commandment
 Information   Age:2 months   Gender:Female   Conscious:Yes   Brea /
 cfset test = reFind(Age:([0-9a-zA-Z ]+)\t, testString, 1, true) /
 cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput

 

 From: Andy Matthews li...@commadelimited.com
 Sent: Monday, June 07, 2010 3:32 PM
 To: cf-talk cf-talk@houseoffusion.com
 Subject: RE: RegEx help

 If you can always depend on Age: before the desired string, and what looks
 like a tab afterwards, then it's trivial:

 Age:[0-9a-Z]+\t

 That assumes that the age will be any combination of letters and numbers,
 and also allows for upper and lower case.

 andy

 -Original Message-
 From: Debbie Morris [mailto:ddicker...@macromedia.com]
 Sent: Monday, June 07, 2010 1:51 PM
 To: cf-talk
 Subject: RegEx help

 I need to extract a particular piece of data from one of my query fields
 and
 I'm not sure how to go about it.

 We have incidents in one table that can have comments in another table
 associated with them.

 Here's an example of one of the comments in my query results that I need
 to
 grab data from:

 Case Information   Problem:diff breathing   Patients:1   Four commandment
 Information   Age:2 months   Gender:Female   Conscious:Yes   Brea

 I need to get the Age information for any comments that contain it. The
 Age
 field always begins as shown above and the Gender field always immediately
 follows it, so I'm assuming I can work from that, but I just don't know
 how
 to go about writing it. Any thoughts would be greatly appreciated!!

 Deb







 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334362
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: RegEx help

2010-06-08 Thread Bobby Hartsfield

Oh. I never saw mention of that... and I think it's a she ;-)

.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
 

-Original Message-
From: Michael Grant [mailto:mgr...@modus.bz] 
Sent: Tuesday, June 08, 2010 11:06 AM
To: cf-talk
Subject: Re: RegEx help


I think he wants to make it part of the t-sql code.

Do you really need to test for all three of these? Will there ever be a
carriage return in the Age value that's valid? If not why not just test for
the carriage return alone as the end part of your regex?


On Tue, Jun 8, 2010 at 11:01 AM, Bobby Hartsfield
bo...@acoderslife.comwrote:


 If you mean test for that exact order of those three characters, you don't
 really need a regex for that. It is just a constant string.

 I believe it would be

 #Chr(13)  chr(10)  ' '#



 .:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
 Bobby Hartsfield
 http://acoderslife.com

 -Original Message-
 From: Debbie Morris [mailto:dmor...@sussexcountyde.gov]
 Sent: Tuesday, June 08, 2010 10:23 AM
 To: cf-talk
 Subject: RE: RegEx help


 Thanks for the help, Jason and Andy. Turns out the character apparently
 isn't a tab though. Viewing it in WireShark, it looks like there is a
 carriage return (0d), a line feed (0a) and a space (20) between the age
and
 gender strings.

 Sorry to be so dumb, but I've managed to avoid regular expressions for the
 most part, so I'm really clueless now that I need it. I've tried reading
 through the documentation but it all seems like Greek to me. How can I
test
 for the combination of those three characters?

 Deb

 -Original Message-
 From: Jason Fisher [mailto:ja...@wanax.com]
 Sent: Monday, June 07, 2010 4:27 PM
 To: cf-talk
 Subject: RE: RegEx help


 Assuming that those are tabs between the elements, the following will
 expand on Andy's suggestion.

 cfset testString = Case Information   Problem:diff breathing
Patients:1
  Four commandment
 Information   Age:2 months   Gender:Female   Conscious:Yes   Brea /
 cfset test = reFind(Age:([0-9a-zA-Z ]+)\t, testString, 1, true) /
 cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput

 

 From: Andy Matthews li...@commadelimited.com
 Sent: Monday, June 07, 2010 3:32 PM
 To: cf-talk cf-talk@houseoffusion.com
 Subject: RE: RegEx help

 If you can always depend on Age: before the desired string, and what looks
 like a tab afterwards, then it's trivial:

 Age:[0-9a-Z]+\t

 That assumes that the age will be any combination of letters and numbers,
 and also allows for upper and lower case.

 andy

 -Original Message-
 From: Debbie Morris [mailto:ddicker...@macromedia.com]
 Sent: Monday, June 07, 2010 1:51 PM
 To: cf-talk
 Subject: RegEx help

 I need to extract a particular piece of data from one of my query fields
 and
 I'm not sure how to go about it.

 We have incidents in one table that can have comments in another table
 associated with them.

 Here's an example of one of the comments in my query results that I need
 to
 grab data from:

 Case Information   Problem:diff breathing   Patients:1   Four commandment
 Information   Age:2 months   Gender:Female   Conscious:Yes   Brea

 I need to get the Age information for any comments that contain it. The
 Age
 field always begins as shown above and the Gender field always immediately
 follows it, so I'm assuming I can work from that, but I just don't know
 how
 to go about writing it. Any thoughts would be greatly appreciated!!

 Deb







 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334363
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: RegEx help

2010-06-08 Thread Michael Grant

I'm wrong. I re-read it and it says query fields which when I first read I
took as database column. My mistake.
And sorry Debbie. She, not he. *_*




On Tue, Jun 8, 2010 at 11:18 AM, Bobby Hartsfield bo...@acoderslife.comwrote:


 Oh. I never saw mention of that... and I think it's a she ;-)

 .:.:.:.:.:.:.:.:.:.:.:.:.:.
 Bobby Hartsfield
 http://acoderslife.com


 -Original Message-
 From: Michael Grant [mailto:mgr...@modus.bz]
 Sent: Tuesday, June 08, 2010 11:06 AM
 To: cf-talk
 Subject: Re: RegEx help


 I think he wants to make it part of the t-sql code.

 Do you really need to test for all three of these? Will there ever be a
 carriage return in the Age value that's valid? If not why not just test for
 the carriage return alone as the end part of your regex?


 On Tue, Jun 8, 2010 at 11:01 AM, Bobby Hartsfield
 bo...@acoderslife.comwrote:

 
  If you mean test for that exact order of those three characters, you
 don't
  really need a regex for that. It is just a constant string.
 
  I believe it would be
 
  #Chr(13)  chr(10)  ' '#
 
 
 
  .:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
  Bobby Hartsfield
  http://acoderslife.com
 
  -Original Message-
  From: Debbie Morris [mailto:dmor...@sussexcountyde.gov]
  Sent: Tuesday, June 08, 2010 10:23 AM
  To: cf-talk
  Subject: RE: RegEx help
 
 
  Thanks for the help, Jason and Andy. Turns out the character apparently
  isn't a tab though. Viewing it in WireShark, it looks like there is a
  carriage return (0d), a line feed (0a) and a space (20) between the age
 and
  gender strings.
 
  Sorry to be so dumb, but I've managed to avoid regular expressions for
 the
  most part, so I'm really clueless now that I need it. I've tried reading
  through the documentation but it all seems like Greek to me. How can I
 test
  for the combination of those three characters?
 
  Deb
 
  -Original Message-
  From: Jason Fisher [mailto:ja...@wanax.com]
  Sent: Monday, June 07, 2010 4:27 PM
  To: cf-talk
  Subject: RE: RegEx help
 
 
  Assuming that those are tabs between the elements, the following will
  expand on Andy's suggestion.
 
  cfset testString = Case Information   Problem:diff breathing
 Patients:1
   Four commandment
  Information   Age:2 months   Gender:Female   Conscious:Yes   Brea /
  cfset test = reFind(Age:([0-9a-zA-Z ]+)\t, testString, 1, true) /
  cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput
 
  
 
  From: Andy Matthews li...@commadelimited.com
  Sent: Monday, June 07, 2010 3:32 PM
  To: cf-talk cf-talk@houseoffusion.com
  Subject: RE: RegEx help
 
  If you can always depend on Age: before the desired string, and what
 looks
  like a tab afterwards, then it's trivial:
 
  Age:[0-9a-Z]+\t
 
  That assumes that the age will be any combination of letters and numbers,
  and also allows for upper and lower case.
 
  andy
 
  -Original Message-
  From: Debbie Morris [mailto:ddicker...@macromedia.com]
  Sent: Monday, June 07, 2010 1:51 PM
  To: cf-talk
  Subject: RegEx help
 
  I need to extract a particular piece of data from one of my query fields
  and
  I'm not sure how to go about it.
 
  We have incidents in one table that can have comments in another table
  associated with them.
 
  Here's an example of one of the comments in my query results that I need
  to
  grab data from:
 
  Case Information   Problem:diff breathing   Patients:1   Four commandment
  Information   Age:2 months   Gender:Female   Conscious:Yes   Brea
 
  I need to get the Age information for any comments that contain it. The
  Age
  field always begins as shown above and the Gender field always
 immediately
  follows it, so I'm assuming I can work from that, but I just don't know
  how
  to go about writing it. Any thoughts would be greatly appreciated!!
 
  Deb
 
 
 
 
 
 
 
 



 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334364
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: RegEx help

2010-06-08 Thread Kris Jones

How about something like this:

cfset arFound =
refindnocase(Age:([^\r\n|\r|\n]*)[\r\n|\r|\n],thestring,1,true) /
cfoutput#mid(thestring,arFound[pos][1],arFound[len][1])#/cfoutput

Cheers,
Kris

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334365
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: RegEx help

2010-06-08 Thread Kris Jones

Rather, that would be, if you don't want the label of the field:
cfoutput#mid(thestring,arFound[pos][2],arFound[len][2])#/cfoutput

Cheers,
Kris


On Tue, Jun 8, 2010 at 11:43 AM, Kris Jones kris.jon...@verizon.net wrote:
 How about something like this:

 cfset arFound =
 refindnocase(Age:([^\r\n|\r|\n]*)[\r\n|\r|\n],thestring,1,true) /
 cfoutput#mid(thestring,arFound[pos][1],arFound[len][1])#/cfoutput

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334366
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: RegEx help

2010-06-08 Thread Jason Fisher

Debbie,

Where 'testString' is your content, try this:

cfset test = reFind(Age:([0-9a-zA-Z ]+)\s*\n, testString, 1, true) /

cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput



From: Debbie Morris dmor...@sussexcountyde.gov
Sent: Tuesday, June 08, 2010 10:24 AM
To: cf-talk cf-talk@houseoffusion.com
Subject: RE: RegEx help

Thanks for the help, Jason and Andy. Turns out the character apparently 
isn't a tab though. Viewing it in WireShark, it looks like there is a 
carriage return (0d), a line feed (0a) and a space (20) between the age and 
gender strings.

Sorry to be so dumb, but I've managed to avoid regular expressions for the 
most part, so I'm really clueless now that I need it. I've tried reading 
through the documentation but it all seems like Greek to me. How can I test 
for the combination of those three characters?

Deb

-Original Message-
From: Jason Fisher [mailto:ja...@wanax.com] 
Sent: Monday, June 07, 2010 4:27 PM
To: cf-talk
Subject: RE: RegEx help

Assuming that those are tabs between the elements, the following will 
expand on Andy's suggestion.

cfset testString = Case Information   Problem:diff breathing   Patients:1 

Four commandment
Information   Age:2 months   Gender:Female   Conscious:Yes   Brea /
cfset test = reFind(Age:([0-9a-zA-Z ]+)\t, testString, 1, true) /
cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput



From: Andy Matthews li...@commadelimited.com
Sent: Monday, June 07, 2010 3:32 PM
To: cf-talk cf-talk@houseoffusion.com
Subject: RE: RegEx help

If you can always depend on Age: before the desired string, and what looks
like a tab afterwards, then it's trivial:

Age:[0-9a-Z]+\t

That assumes that the age will be any combination of letters and numbers,
and also allows for upper and lower case.

andy

-Original Message-
From: Debbie Morris [mailto:ddicker...@macromedia.com] 
Sent: Monday, June 07, 2010 1:51 PM
To: cf-talk
Subject: RegEx help

I need to extract a particular piece of data from one of my query fields 
and
I'm not sure how to go about it.

We have incidents in one table that can have comments in another table
associated with them.

Here's an example of one of the comments in my query results that I need 
to
grab data from:

Case Information   Problem:diff breathing   Patients:1   Four commandment
Information   Age:2 months   Gender:Female   Conscious:Yes   Brea

I need to get the Age information for any comments that contain it. The 
Age
field always begins as shown above and the Gender field always immediately
follows it, so I'm assuming I can work from that, but I just don't know 
how
to go about writing it. Any thoughts would be greatly appreciated!!

Deb 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334367
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: RegEx help

2010-06-08 Thread Debbie Morris

Thank you (and everyone else)!! This one did the trick!

Now I just need to finish the logic around it so that it doesn't break when 
there aren't any comments that match, and I can get this off my plate before I 
leave for vacation!

Thanks again!

Deb

-Original Message-
From: Jason Fisher [mailto:ja...@wanax.com] 
Sent: Tuesday, June 08, 2010 11:40 AM
To: cf-talk
Subject: RE: RegEx help


Debbie,

Where 'testString' is your content, try this:

cfset test = reFind(Age:([0-9a-zA-Z ]+)\s*\n, testString, 1, true) /

cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput



From: Debbie Morris dmor...@sussexcountyde.gov
Sent: Tuesday, June 08, 2010 10:24 AM
To: cf-talk cf-talk@houseoffusion.com
Subject: RE: RegEx help

Thanks for the help, Jason and Andy. Turns out the character apparently 
isn't a tab though. Viewing it in WireShark, it looks like there is a 
carriage return (0d), a line feed (0a) and a space (20) between the age and 
gender strings.

Sorry to be so dumb, but I've managed to avoid regular expressions for the 
most part, so I'm really clueless now that I need it. I've tried reading 
through the documentation but it all seems like Greek to me. How can I test 
for the combination of those three characters?

Deb

-Original Message-
From: Jason Fisher [mailto:ja...@wanax.com] 
Sent: Monday, June 07, 2010 4:27 PM
To: cf-talk
Subject: RE: RegEx help

Assuming that those are tabs between the elements, the following will 
expand on Andy's suggestion.

cfset testString = Case Information   Problem:diff breathing   Patients:1 

Four commandment
Information   Age:2 months   Gender:Female   Conscious:Yes   Brea /
cfset test = reFind(Age:([0-9a-zA-Z ]+)\t, testString, 1, true) /
cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput



From: Andy Matthews li...@commadelimited.com
Sent: Monday, June 07, 2010 3:32 PM
To: cf-talk cf-talk@houseoffusion.com
Subject: RE: RegEx help

If you can always depend on Age: before the desired string, and what looks
like a tab afterwards, then it's trivial:

Age:[0-9a-Z]+\t

That assumes that the age will be any combination of letters and numbers,
and also allows for upper and lower case.

andy

-Original Message-
From: Debbie Morris [mailto:ddicker...@macromedia.com] 
Sent: Monday, June 07, 2010 1:51 PM
To: cf-talk
Subject: RegEx help

I need to extract a particular piece of data from one of my query fields 
and
I'm not sure how to go about it.

We have incidents in one table that can have comments in another table
associated with them.

Here's an example of one of the comments in my query results that I need 
to
grab data from:

Case Information   Problem:diff breathing   Patients:1   Four commandment
Information   Age:2 months   Gender:Female   Conscious:Yes   Brea

I need to get the Age information for any comments that contain it. The 
Age
field always begins as shown above and the Gender field always immediately
follows it, so I'm assuming I can work from that, but I just don't know 
how
to go about writing it. Any thoughts would be greatly appreciated!!

Deb 





~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334369
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: RegEx help

2010-06-08 Thread Bobby Hartsfield

Vaca... vacati... hmmm, I'm not sure I'm familiar with that word. 

:-P

 
.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
 
-Original Message-
From: Debbie Morris [mailto:dmor...@sussexcountyde.gov] 
Sent: Tuesday, June 08, 2010 12:45 PM
To: cf-talk
Subject: RE: RegEx help


Thank you (and everyone else)!! This one did the trick!

Now I just need to finish the logic around it so that it doesn't break when
there aren't any comments that match, and I can get this off my plate before
I leave for vacation!

Thanks again!

Deb

-Original Message-
From: Jason Fisher [mailto:ja...@wanax.com] 
Sent: Tuesday, June 08, 2010 11:40 AM
To: cf-talk
Subject: RE: RegEx help


Debbie,

Where 'testString' is your content, try this:

cfset test = reFind(Age:([0-9a-zA-Z ]+)\s*\n, testString, 1, true) /

cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput



From: Debbie Morris dmor...@sussexcountyde.gov
Sent: Tuesday, June 08, 2010 10:24 AM
To: cf-talk cf-talk@houseoffusion.com
Subject: RE: RegEx help

Thanks for the help, Jason and Andy. Turns out the character apparently 
isn't a tab though. Viewing it in WireShark, it looks like there is a 
carriage return (0d), a line feed (0a) and a space (20) between the age and 
gender strings.

Sorry to be so dumb, but I've managed to avoid regular expressions for the 
most part, so I'm really clueless now that I need it. I've tried reading 
through the documentation but it all seems like Greek to me. How can I test 
for the combination of those three characters?

Deb

-Original Message-
From: Jason Fisher [mailto:ja...@wanax.com] 
Sent: Monday, June 07, 2010 4:27 PM
To: cf-talk
Subject: RE: RegEx help

Assuming that those are tabs between the elements, the following will 
expand on Andy's suggestion.

cfset testString = Case Information   Problem:diff breathing   Patients:1 

Four commandment
Information   Age:2 months   Gender:Female   Conscious:Yes   Brea /
cfset test = reFind(Age:([0-9a-zA-Z ]+)\t, testString, 1, true) /
cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput



From: Andy Matthews li...@commadelimited.com
Sent: Monday, June 07, 2010 3:32 PM
To: cf-talk cf-talk@houseoffusion.com
Subject: RE: RegEx help

If you can always depend on Age: before the desired string, and what looks
like a tab afterwards, then it's trivial:

Age:[0-9a-Z]+\t

That assumes that the age will be any combination of letters and numbers,
and also allows for upper and lower case.

andy

-Original Message-
From: Debbie Morris [mailto:ddicker...@macromedia.com] 
Sent: Monday, June 07, 2010 1:51 PM
To: cf-talk
Subject: RegEx help

I need to extract a particular piece of data from one of my query fields 
and
I'm not sure how to go about it.

We have incidents in one table that can have comments in another table
associated with them.

Here's an example of one of the comments in my query results that I need 
to
grab data from:

Case Information   Problem:diff breathing   Patients:1   Four commandment
Information   Age:2 months   Gender:Female   Conscious:Yes   Brea

I need to get the Age information for any comments that contain it. The 
Age
field always begins as shown above and the Gender field always immediately
follows it, so I'm assuming I can work from that, but I just don't know 
how
to go about writing it. Any thoughts would be greatly appreciated!!

Deb 







~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334370
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: RegEx help

2010-06-07 Thread Andy Matthews

If you can always depend on Age: before the desired string, and what looks
like a tab afterwards, then it's trivial:

Age:[0-9a-Z]+\t

That assumes that the age will be any combination of letters and numbers,
and also allows for upper and lower case.


andy


-Original Message-
From: Debbie Morris [mailto:ddicker...@macromedia.com] 
Sent: Monday, June 07, 2010 1:51 PM
To: cf-talk
Subject: RegEx help


I need to extract a particular piece of data from one of my query fields and
I'm not sure how to go about it.

We have incidents in one table that can have comments in another table
associated with them.

Here's an example of one of the comments in my query results that I need to
grab data from:

Case Information   Problem:diff breathing   Patients:1   Four commandment
Information   Age:2 months   Gender:Female   Conscious:Yes   Brea

I need to get the Age information for any comments that contain it. The Age
field always begins as shown above and the Gender field always immediately
follows it, so I'm assuming I can work from that, but I just don't know how
to go about writing it. Any thoughts would be greatly appreciated!!

Deb 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334347
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: RegEx help

2010-06-07 Thread Jason Fisher

Assuming that those are tabs between the elements, the following will 
expand on Andy's suggestion.

cfset testString = Case Information   Problem:diff breathing   Patients:1 
  Four commandment
Information   Age:2 months   Gender:Female   Conscious:Yes   Brea /
cfset test = reFind(Age:([0-9a-zA-Z ]+)\t, testString, 1, true) /
cfoutput#mid(testString, test.pos[2], test.len[2])#/cfoutput



From: Andy Matthews li...@commadelimited.com
Sent: Monday, June 07, 2010 3:32 PM
To: cf-talk cf-talk@houseoffusion.com
Subject: RE: RegEx help

If you can always depend on Age: before the desired string, and what looks
like a tab afterwards, then it's trivial:

Age:[0-9a-Z]+\t

That assumes that the age will be any combination of letters and numbers,
and also allows for upper and lower case.

andy

-Original Message-
From: Debbie Morris [mailto:ddicker...@macromedia.com] 
Sent: Monday, June 07, 2010 1:51 PM
To: cf-talk
Subject: RegEx help

I need to extract a particular piece of data from one of my query fields 
and
I'm not sure how to go about it.

We have incidents in one table that can have comments in another table
associated with them.

Here's an example of one of the comments in my query results that I need 
to
grab data from:

Case Information   Problem:diff breathing   Patients:1   Four commandment
Information   Age:2 months   Gender:Female   Conscious:Yes   Brea

I need to get the Age information for any comments that contain it. The 
Age
field always begins as shown above and the Gender field always immediately
follows it, so I'm assuming I can work from that, but I just don't know 
how
to go about writing it. Any thoughts would be greatly appreciated!!

Deb 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334351
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Regex help with invalid HTML

2009-11-17 Thread Peter Boughton

 I have no control over this code 

The only time parsing HTML with RegEx might be remotely viable is when you know 
what that code will be - if the HTML is uncontrolled then using RegEx is a 
futile effort.

RegEx is for dealing with Regular text, and HTML is not a Regular language - 
even modern regex engines that implement non-Regular features *cannot* deal 
with the potential complexity of HTML.

The correct solution is to **use a tool designed for parsing HTML**.

There isn't one native to CF, but there are a number of Java ones available - 
take a look at:
http://java-source.net/open-source/html-parsers

I haven't used any of those, I'd probably start with TagSoup or NekoHTML since 
they look promising, but any HTML parser that produces a DOM structure which 
you can run XPath expressions against will allow you to extract the specific 
information you want.

So yeah, it might involve a bit of effort getting one of those to work, but 
it's far more stable and reliable than attempting to use regex for something it 
simply isn't designed for. 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328460
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Regex help with invalid HTML

2009-11-17 Thread Mark Henderson

List wrote at 17 November 2009 14:32:
 Andy matthews, you're welcome.

Ah hah, that's a name I'm more familiar with.

 testing

Roger.  And excuse the previously poorly formatted code (it looked ok at
my end before sending but occasionally in Outlook 2007 when I copy and
paste from external apps that happens).

Over and out.

Mark  


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328477
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Regex help with invalid HTML

2009-11-17 Thread Mark Henderson

Peter Boughton wrote on Wed 18/11/2009 at 03:12:

 The only time parsing HTML with RegEx might be remotely viable is when
you know
 what that code will be - if the HTML is uncontrolled then using RegEx
is a futile effort.
 
 RegEx is for dealing with Regular text, and HTML is not a Regular
language - even
 modern regex engines that implement non-Regular features *cannot* deal
with the
 potential complexity of HTML.
 
 The correct solution is to **use a tool designed for parsing HTML**.

Ok Peter, thanks for the heads-up.


 There isn't one native to CF, but there are a number of Java ones
available - take a
 look at:
 http://java-source.net/open-source/html-parsers
 
 I haven't used any of those, I'd probably start with TagSoup or
NekoHTML since they
 look promising, but any HTML parser that produces a DOM structure
which you can
 run XPath expressions against will allow you to extract the specific
information you
 want.

TagSoup it is.

Mark

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328478
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Regex help with invalid HTML

2009-11-16 Thread Mark Henderson

Azadi Saryev wrote on 16 November 2009 at 17:58

 you can do it with something like this:
 cfset line='trtd class=la href=/blah.com/atd31
622td25
 623td193 645td840 642td1.9 GB'
 cfset cleanline = rereplace(line, 't[^]+', '|', 'all')
 cfoutput#listfirst(cleanline, '|')# #listlast(cleanline,
'|')#/cfoutput
 
 and if you do not want any html in final result (not even a tag),
then
 use:
 cfset cleanline = rereplace(line, '[^]+', '|', 'all')
 

Thanks Azadi. That's all I needed to get the thought processes rolling
in the right direction (it never occurred to me to check each entry was
on a new line, so thanks also to the individual I can only refer to as
list!). 

Here's the truncated code relevant to the question I asked that's
working:

cfhttp url=http://localhost/statsmerged.html;

cfset sStartString = cfhttp.filecontent
cfset sStartTag = FindNoCase(td class='l', sStartString)
cfset sTempString = RemoveChars(sStartString,1, sStartTag-1)
cfset sEndTag = FindNoCase(/table, sTempString)
cfset sFinalString = RemoveChars(sTempString,sEndTag,
Len(sTempString))

cfloop index=thisLine list=#sFinalString#
delimiters=#chr(10)##chr(13)# 
  cfset cleanLine = ReReplace(thisLine, '[^]+', '|', 'all')
  cfoutput#listFirst(cleanLine, '|')# #listLast(cleanLine,
'|')#/cfoutput
/cfloop


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328444
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Regex help with invalid HTML

2009-11-16 Thread lists

Andy matthews, you're welcome. 

-Original Message-
From: Mark Henderson [mailto:m...@cwc.co.nz] 
Sent: Monday, November 16, 2009 4:29 PM
To: cf-talk
Subject: RE: Regex help with invalid HTML


Azadi Saryev wrote on 16 November 2009 at 17:58

 you can do it with something like this:
 cfset line='trtd class=la href=/blah.com/atd31
622td25
 623td193 645td840 642td1.9 GB'
 cfset cleanline = rereplace(line, 't[^]+', '|', 'all') 
 cfoutput#listfirst(cleanline, '|')# #listlast(cleanline,
'|')#/cfoutput
 
 and if you do not want any html in final result (not even a tag),
then
 use:
 cfset cleanline = rereplace(line, '[^]+', '|', 'all')
 

Thanks Azadi. That's all I needed to get the thought processes rolling in
the right direction (it never occurred to me to check each entry was on a
new line, so thanks also to the individual I can only refer to as list!). 

Here's the truncated code relevant to the question I asked that's
working:

cfhttp url=http://localhost/statsmerged.html;

cfset sStartString = cfhttp.filecontent cfset sStartTag = FindNoCase(td
class='l', sStartString) cfset sTempString = RemoveChars(sStartString,1,
sStartTag-1) cfset sEndTag = FindNoCase(/table, sTempString) cfset
sFinalString = RemoveChars(sTempString,sEndTag, Len(sTempString))

cfloop index=thisLine list=#sFinalString#
delimiters=#chr(10)##chr(13)#
  cfset cleanLine = ReReplace(thisLine, '[^]+', '|', 'all')
  cfoutput#listFirst(cleanLine, '|')# #listLast(cleanLine,
'|')#/cfoutput /cfloop




~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328450
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Regex help with invalid HTML

2009-11-16 Thread lists

testing 

-Original Message-
From: Mark Henderson [mailto:m...@cwc.co.nz] 
Sent: Monday, November 16, 2009 4:29 PM
To: cf-talk
Subject: RE: Regex help with invalid HTML


Azadi Saryev wrote on 16 November 2009 at 17:58

 you can do it with something like this:
 cfset line='trtd class=la href=/blah.com/atd31
622td25
 623td193 645td840 642td1.9 GB'
 cfset cleanline = rereplace(line, 't[^]+', '|', 'all') 
 cfoutput#listfirst(cleanline, '|')# #listlast(cleanline,
'|')#/cfoutput
 
 and if you do not want any html in final result (not even a tag),
then
 use:
 cfset cleanline = rereplace(line, '[^]+', '|', 'all')
 

Thanks Azadi. That's all I needed to get the thought processes rolling in
the right direction (it never occurred to me to check each entry was on a
new line, so thanks also to the individual I can only refer to as list!). 

Here's the truncated code relevant to the question I asked that's
working:

cfhttp url=http://localhost/statsmerged.html;

cfset sStartString = cfhttp.filecontent cfset sStartTag = FindNoCase(td
class='l', sStartString) cfset sTempString = RemoveChars(sStartString,1,
sStartTag-1) cfset sEndTag = FindNoCase(/table, sTempString) cfset
sFinalString = RemoveChars(sTempString,sEndTag, Len(sTempString))

cfloop index=thisLine list=#sFinalString#
delimiters=#chr(10)##chr(13)#
  cfset cleanLine = ReReplace(thisLine, '[^]+', '|', 'all')
  cfoutput#listFirst(cleanLine, '|')# #listLast(cleanLine,
'|')#/cfoutput /cfloop




~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328451
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Regex help with invalid HTML

2009-11-15 Thread lists

Will it always be a domain name you want to keep? And will the file size
always be at the very end of the line? 

-Original Message-
From: Mark Henderson [mailto:m...@cwc.co.nz] 
Sent: Sunday, November 15, 2009 8:38 PM
To: cf-talk
Subject: Regex help with invalid HTML


Calling all regex gurus. I've spent a little time on this so now it's time
to seek advice from the professionals. Here is an example of the content I'm
working with:

trtd class=la href=/abc.co.nz/atd52 363td73 815td5 122
265td2 166 760td471.47 MB
trtd class=la href=/xyz.co.nz/atd31 622td23 443td193
645td840 642td1.8 GB trtd class=la href=/blah.com/atd31
622td25 623td193 645td840 642td1.9 GB

And what I want to do is remove everything between the first td (after the
closing /a) and the last td BEFORE the next tr.

E.G. This
trtd class=la href=/abc.co.nz/atd52 363td73 815td5 122
265td2 166 760td471.47 MB 

becomes

trtd class=la href=/abc.co.nz/a 471.47 MB

At that point I will then strip all the remaining HTML tags (which I can
do) and I should be good to go. Unfortunately I have no control over this
code as it is generated by a stats program, and if indeed it used the
correct closing tags and validated I could probably fumble around and
eventually achieve what I want, as I've done in the past.  And just in case
anyone out there can do all this in one hit, ultimately I want the output
from above to look like this:

abc.co.nz 471.47 MB
xyz.co.nz 1.8 GB
blah.com 1.9 GB
etc.

I hope that makes sense.


TIA
Mark



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328403
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Regex help with invalid HTML

2009-11-15 Thread Mark Henderson

lists wrote:
 Will it always be a domain name you want to keep? And will the file
size
 always be at the very end of the line?

Yes, and yes (confirmed all the TRs start on a new line).


Regards

Mark

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328404
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Regex help with invalid HTML

2009-11-15 Thread Azadi Saryev

you can do it with something like this:
cfset line='trtd class=la href=/blah.com/atd31 622td25
623td193 645td840 642td1.9 GB'
cfset cleanline = rereplace(line, 't[^]+', '|', 'all')
cfoutput#listfirst(cleanline, '|')# #listlast(cleanline, '|')#/cfoutput

and if you do not want any html in final result (not even a tag), then
use:
cfset cleanline = rereplace(line, '[^]+', '|', 'all')

Azadi Saryev



On 16/11/2009 10:37, Mark Henderson wrote:
 Calling all regex gurus. I've spent a little time on this so now it's
 time to seek advice from the professionals. Here is an example of the
 content I'm working with:

 trtd class=la href=/abc.co.nz/atd52 363td73 815td5 122
 265td2 166 760td471.47 MB
 trtd class=la href=/xyz.co.nz/atd31 622td23 443td193
 645td840 642td1.8 GB
 trtd class=la href=/blah.com/atd31 622td25 623td193
 645td840 642td1.9 GB

 And what I want to do is remove everything between the first td (after
 the closing /a) and the last td BEFORE the next tr.

 E.G. This 
 trtd class=la href=/abc.co.nz/atd52 363td73 815td5 122
 265td2 166 760td471.47 MB 

 becomes

 trtd class=la href=/abc.co.nz/a 471.47 MB

 At that point I will then strip all the remaining HTML tags (which I can
 do) and I should be good to go. Unfortunately I have no control over
 this code as it is generated by a stats program, and if indeed it used
 the correct closing tags and validated I could probably fumble around
 and eventually achieve what I want, as I've done in the past.  And just
 in case anyone out there can do all this in one hit, ultimately I want
 the output from above to look like this:

 abc.co.nz 471.47 MB
 xyz.co.nz 1.8 GB
 blah.com 1.9 GB
 etc.

 I hope that makes sense.


 TIA
 Mark

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328405
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Regex Help - Can this be simplified?

2009-08-17 Thread Peter Boughton

The easiest to read solution is one line:

cfset finalDescription = fiddleWithParas(form.description) /


Of course, that function will then contain a nicely spaced easy-to-read piece 
of logic, which almost certainly wont be a horrible single line of nested 
replaces. 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325495
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Regex Help - Can this be simplified?

2009-08-13 Thread Dave Phillips

I'm not an expert with Regex, but you could do this:

cfset finalDescription =
replace(replace(replace(trim(form.description),br,br/,all),p/p
,br /br /,all),p,br /br /,all) 

Again, this is not regex, but it is a much more simplified (and faster I
believe) way of doing the same thing with 1 line of code.

Dave Phillips
-Original Message-
From: Che Vilnonis [mailto:ch...@asitv.com] 
Sent: Thursday, August 13, 2009 1:14 PM
To: cf-talk
Subject: Regex Help - Can this be simplified?


Is there a way using CF's Regex functions to simplfy the lines of code below
into one line? Some kind of built in regex list comparison maybe?

cfset finalDescription = replace(trim(form.description), br, br /,
ALL)
cfset finalDescription = replace(finalDescription, p/p, br /br
/, ALL)
cfset finalDescription = replace(finalDescription, p, br /br /,
ALL)

Thanks, CV



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325436
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Regex Help - Can this be simplified?

2009-08-13 Thread Charlie Griefer

less lines != simplified :)

A year from now, which version are you going to want to come back to when it
needs work?  The 3 line version or the 1?

I'd prefer the 3.  Easier to read.

Not really sure a regex solution is warranted here.  You could probably get
one whipped up to find all instances of the tag combinations that you
want... but not all instances are replaced with the same string.  Only the
first one (the br) is replaced with a single br /.  The others are
replaced with two br /s.

Also curious about the need to replace p/p with br /br /.  I'm not a
CSS guru, but I believe the two are semantically different.  One (the p /)
is meant to contain text.  The other (br /) just meant to force a space.

p/p will give you more flexibility via CSS to style individual
paragraphs.  You might not have that need now, which is fine.  But by
replacing all p / elements with br /br / you're effectively giving up
that flexibility forever.

On Thu, Aug 13, 2009 at 11:19 AM, Dave Phillips 
experiencedcfdevelo...@gmail.com wrote:


 I'm not an expert with Regex, but you could do this:

 cfset finalDescription =

 replace(replace(replace(trim(form.description),br,br/,all),p/p
 ,br /br /,all),p,br /br /,all) 

 Again, this is not regex, but it is a much more simplified (and faster I
 believe) way of doing the same thing with 1 line of code.

 Dave Phillips
 -Original Message-
 From: Che Vilnonis [mailto:ch...@asitv.com]
 Sent: Thursday, August 13, 2009 1:14 PM
 To: cf-talk
 Subject: Regex Help - Can this be simplified?


 Is there a way using CF's Regex functions to simplfy the lines of code
 below
 into one line? Some kind of built in regex list comparison maybe?

 cfset finalDescription = replace(trim(form.description), br, br /,
 ALL)
 cfset finalDescription = replace(finalDescription, p/p, br /br
 /, ALL)
 cfset finalDescription = replace(finalDescription, p, br /br /,
 ALL)

 Thanks, CV



 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325437
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Regex Help - Can this be simplified?

2009-08-13 Thread Che Vilnonis

Charlie, think of my problem like this. Say you had any 5 character combos
you wanted to remove, for whatever reason.
I'm just looking for a simpler (or so I thought) RegEx way to do this.

I could loop over a list, but I thought (perhaps naively) there might be a
Regex function that could accepta a list of chars and then replace any of
them when a match was found.

-Original Message-
From: Charlie Griefer [mailto:charlie.grie...@gmail.com] 
Sent: Thursday, August 13, 2009 2:29 PM
To: cf-talk
Subject: Re: Regex Help - Can this be simplified?


less lines != simplified :)

A year from now, which version are you going to want to come back to when it
needs work?  The 3 line version or the 1?

I'd prefer the 3.  Easier to read.

Not really sure a regex solution is warranted here.  You could probably get
one whipped up to find all instances of the tag combinations that you
want... but not all instances are replaced with the same string.  Only the
first one (the br) is replaced with a single br /.  The others are
replaced with two br /s.

Also curious about the need to replace p/p with br /br /.  I'm not a
CSS guru, but I believe the two are semantically different.  One (the p /)
is meant to contain text.  The other (br /) just meant to force a space.

p/p will give you more flexibility via CSS to style individual
paragraphs.  You might not have that need now, which is fine.  But by
replacing all p / elements with br /br / you're effectively giving up
that flexibility forever.



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325438
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Regex Help - Can this be simplified?

2009-08-13 Thread Dave Phillips

This, of course, is completely a matter of opinion.  I prefer 1 line -
faster processing, and still easy to support.  Again, that's MY opinion, and
I'm sure we have about a hundred other opinions on this list.  There's no
doubt that there are many ways to accomplish something in ColdFusion.  But
an alternate method should not be shot down as not simplified especially
when the provider of the alternate method was just trying to help.

Dave Phillips

-Original Message-
From: Charlie Griefer [mailto:charlie.grie...@gmail.com] 
Sent: Thursday, August 13, 2009 1:29 PM
To: cf-talk
Subject: Re: Regex Help - Can this be simplified?


less lines != simplified :)

A year from now, which version are you going to want to come back to when it
needs work?  The 3 line version or the 1?

I'd prefer the 3.  Easier to read.


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325440
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Regex Help - Can this be simplified?

2009-08-13 Thread Tony Bentley

rereplace(string,(p)+(/p),br,all)


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325441
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Regex Help - Can this be simplified?

2009-08-13 Thread Charlie Griefer

Easy there, killer.  You said A.  I said B.  You didn't preface it with
in my opinion any more than I did.

I still maintain that (in my opinion), it's preferable to write more legible
code.  The single line may be just as easily readable for you, but you may
not always be the one maintaining your code.

On Thu, Aug 13, 2009 at 11:40 AM, Dave Phillips 
experiencedcfdevelo...@gmail.com wrote:


 This, of course, is completely a matter of opinion.  I prefer 1 line -
 faster processing, and still easy to support.  Again, that's MY opinion,
 and
 I'm sure we have about a hundred other opinions on this list.  There's no
 doubt that there are many ways to accomplish something in ColdFusion.  But
 an alternate method should not be shot down as not simplified especially
 when the provider of the alternate method was just trying to help.

 Dave Phillips

 -Original Message-
 From: Charlie Griefer [mailto:charlie.grie...@gmail.com]
 Sent: Thursday, August 13, 2009 1:29 PM
 To: cf-talk
 Subject: Re: Regex Help - Can this be simplified?


 less lines != simplified :)

 A year from now, which version are you going to want to come back to when
 it
 needs work?  The 3 line version or the 1?

 I'd prefer the 3.  Easier to read.


 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325442
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Regex Help - Can this be simplified?

2009-08-13 Thread Tony Bentley

Sorry I didn't read the post very well

rereplace(form.description,(p)+(/p)+(br),br/,all)

This does not replace a single p with br/br/ but I think it does the job. 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325443
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Regex Help - Can this be simplified?

2009-08-13 Thread Che Vilnonis

There ya go. :) Just found out you can use the pipe | as well. 

-Original Message-
From: Tony Bentley [mailto:t...@tonybentley.com] 
Sent: Thursday, August 13, 2009 2:35 PM
To: cf-talk
Subject: Re: Regex Help - Can this be simplified?


rereplace(string,(p)+(/p),br,all)




~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325444
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Regex Help - Can this be simplified?

2009-08-13 Thread Tony Bentley

You're better off using regex-replace(){rereplace()} over replace() for more 
than one condition. The pipe is a way to cheat the replace function but for 
future string searching or replacing functions, try regex and you can even test 
it online here:

http://www.cftopper.com/contentfiles/tools/regularExpTester.cfm



There ya go. :) Just found out you can use the pipe | as well. 

rereplace(string,(p)+(/p),br,all) 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325446
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Regex Help - Can this be simplified?

2009-08-13 Thread Gabriel

You don't actually need a regex to put this into one easily read line:

replaceList(trim(finalDesription), 'br,p/p,p,/p', 'br /,br
/br /,br /br /,')

... Or some derivative there of.

Performance may differ slightly in favour of one way or another, but as much
as I love regexs and I use them frequently, they're rarely easy to descipher
at a glance.

Gabriel
 

-Original Message-
From: Tony Bentley [mailto:t...@tonybentley.com] 
Sent: Friday, 14 August 2009 5:59 AM
To: cf-talk
Subject: Re: Regex Help - Can this be simplified?


You're better off using regex-replace(){rereplace()} over replace() for more
than one condition. The pipe is a way to cheat the replace function but for
future string searching or replacing functions, try regex and you can even
test it online here:

http://www.cftopper.com/contentfiles/tools/regularExpTester.cfm



There ya go. :) Just found out you can use the pipe | as well. 

rereplace(string,(p)+(/p),br,all)



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325447
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: RegEx Help

2009-07-23 Thread Barney Boisvert

How about load jquery and do

jQuery(a).click(function() {
  logme(jQuery(this).attr(href));
});

On Thu, Jul 23, 2009 at 2:04 PM, Duane Boudreaudu...@sandybay.com wrote:

 I need a little quick (hopefully) regex help.

 I have to modify all the links on a site that do not contain onclick events

 Here is the regex and sample code I have:

 cfsavecontent variable=myContent
 a href=/downloads/abc.pdfClick here for File/abr/
 a href=/files/xyz.xls onclick=logme('/files/xyz.xls');Click here for 
 File/a
 /cfsavecontent

 ReReplaceNoCase(myContent, (a href=)(.*?) ()(.*?)(/a), \1\2 
 onclick=logme('\2')\3\4\5, all)

 this works fine as long as the link doesn't already have an onclick event in 
 it.

 Any ideas what I need to change?

 TIA,
 Duane


 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324905
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: RegEx Help

2009-07-23 Thread Duane Boudreau

Its only for links imbedded in content. the content is editable by the site 
admins and once the initial script is run the admins what the ability to edit 
the logme codes. I modified FCKEdit to allow me to edit the codes but I need to 
write a script to seed the content

Duane

-Original Message-
From: Barney Boisvert [mailto:bboisv...@gmail.com] 
Sent: Thursday, July 23, 2009 6:14 PM
To: cf-talk
Subject: Re: RegEx Help


How about load jquery and do

jQuery(a).click(function() {
  logme(jQuery(this).attr(href));
});

On Thu, Jul 23, 2009 at 2:04 PM, Duane Boudreaudu...@sandybay.com wrote:

 I need a little quick (hopefully) regex help.

 I have to modify all the links on a site that do not contain onclick events

 Here is the regex and sample code I have:

 cfsavecontent variable=myContent
 a href=/downloads/abc.pdfClick here for File/abr/
 a href=/files/xyz.xls onclick=logme('/files/xyz.xls');Click here for 
 File/a
 /cfsavecontent

 ReReplaceNoCase(myContent, (a href=)(.*?) ()(.*?)(/a), \1\2 
 onclick=logme('\2')\3\4\5, all)

 this works fine as long as the link doesn't already have an onclick event in 
 it.

 Any ideas what I need to change?

 TIA,
 Duane


 



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324906
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Regex help...

2009-05-29 Thread Claude Schneegans

Hi,

For this type of parsing, you should have a look at CF_REextract:
http://customtags.internetique.com/REextract/testREextract.cfm

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322973
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Regex help...

2009-05-29 Thread Che Vilnonis

Tom, you could try this...

cfhttp url=http://www.somedomain.com; method=GET result=theData
cfset allURLs = reMatchNoCase(a([^]*[^/]?),
trim(theData.fileContent))
cfdump var=#allURLs# 

-Original Message-
From: Tom Jones [mailto:tjo...@acworld.com] 
Sent: Friday, May 29, 2009 11:03 AM
To: cf-talk
Subject: Regex help...


Hello,
I'm trying to use cfhttp to download and parse a directory listing from one
of my sites. I can download the page but the parsing is a whole different
story :-).

I'm trying to use REFind to get all of the anchor/href tags but I'm coming
up short.

If I use the following regular expression in a script it works fine, I just
dont know with CF, I have not used much RE in CF yet.

Thanks,
tom

cfset rawHTTP=#CFHTTP.FileContent#
cfset reMatch =
REFind(a.*?href=['](?url.*?)['].*?(?name.*?)/a,rawHTTP,1,TRUE
)
cfdump var=#reMatch# 



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322974
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Regex help...

2009-05-29 Thread Tom Chiverton

On Friday 29 May 2009, Tom Jones wrote:
 If I use the following regular expression in a script it works fine, I just
 dont know with CF, I have not used much RE in CF yet.

http://txt2re.com/

-- 
Helping to globally grow world-class 24/7 unique partnerships as part of the 
IT team of the year, '09 and '08

Tom Chiverton
Developer
Tel: +44 0161 618 5032
Fax: +44 0161 618 5099 
tom.chiver...@halliwells.com
3 Hardman Square, Manchester, M3 3EB
www.Halliwells.com



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at 
Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of 
members is available for inspection at the registered office together with a 
list of those non members who are referred to as partners. We use the word 
“partner” to refer to a member of the LLP, or an employee or consultant with 
equivalent standing and qualifications. Regulated by the Solicitors Regulation 
Authority.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged. If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents. If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 2500.

For more information about Halliwells LLP visit www.Halliwells.com.

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322975
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Regex help...

2009-05-29 Thread Peter Boughton

 I'm trying to use REFind to get all of the anchor/href tags but I'm 
 coming up short.

RegEx is not necessarily the ideal tool for this - try a DOM Parser.


If you've got consistent/controlled input you can use regex, and here's a Java 
one that will work in most situations:

a[^]+?\shref\s*+=\s*+[']([^']++)['][^]++(.*?)/a


To use that with CFML, you can use my jre-utils CFC (which is GPL Free 
Software, rather than a $15 per server tag).

Here's an example, along with a commented version of the above regex:

cfset jre = createObject('component','jre-utils').init()/

cfsavecontent variable=reFindHyperlinks(?xis)
  # Flags (above):
  # x = enable regex comment-mode;
  # i = make case-insensitive;
  # s = allow . to match newlines;
  # Main Regex:
a[^]+?  # start of tag, lazily match at least one non-
\bhref\s*+=\s*+   # match href attribute, word boundary at start, allow 
whitespace around =
[']([^']++)['] # match value of href, possessive capture contents 
between the quotes (note: doesn't support inverted embedded quotes)
[^]++   # rest of tag, possessively matching non- then 
(.*?) # lazily capture any tag contents 
/a  # end of tag
/cfsavecontent

cfset Results = jre.matchGroups( reFindHyperlinks , cfhttp.FileContent ) /
cfdump var=#Results# /

That will set Results to an array of matches, each one containing a struct with 
the matched string, plus an array of the groups.


All make sense? 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322985
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Regex help

2009-01-30 Thread Nathan Strutz

so like

b[\w]+\.[\...@[\w]+\.[\w]{2,5}/b

That's really basic, but should be easy to understand.


nathan strutz
[Blog and Family @ http://www.dopefly.com/]
[AZCFUG Manager @ http://www.azcfug.org/]



On Fri, Jan 30, 2009 at 9:08 AM, Dean Lawrence dean...@gmail.com wrote:


 Hi All,

 Can anyone help me with a particular regex patten? I am trying to find any
 email address that has at least one dot in the username portion and the
 entire email string is surrounded by bold tags?

 Thanks

 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318668
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Regex help

2009-01-30 Thread Patrick Santora

Try this:

cfset string = this is bfirstname.lastname...@email.com/b email
address /
cfset email =
refindNoCase((b)(([A-Z0-9_%+-]*\.)+[a-z0-9_%+...@[a-z0-9.-]+\.[a-z]{2,4})(\/b),
string, 1, true )/

cfdump var=#mid( string, email.POS[3], email.LEN[3] )#

On Fri, Jan 30, 2009 at 8:08 AM, Dean Lawrence dean...@gmail.com wrote:


 Hi All,

 Can anyone help me with a particular regex patten? I am trying to find any
 email address that has at least one dot in the username portion and the
 entire email string is surrounded by bold tags?

 Thanks

 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318677
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Regex help

2009-01-30 Thread Patrick Santora

This pattern should account for strong as well now:
cfset email =
refindNoCase((b|strong)(([A-Z0-9_%+-]*\.)+[a-z0-9_%+...@[a-z0-9.-]+\.[a-z]{2,4})(\/b|\/strong),
string, 1, true )/

Just amend the tag you want to wrap around the email (b|strong) and
(\/b|\/strong) as shown above. Pipes are the or operators.

-Pat

On Fri, Jan 30, 2009 at 8:08 AM, Dean Lawrence dean...@gmail.com wrote:


 Hi All,

 Can anyone help me with a particular regex patten? I am trying to find any
 email address that has at least one dot in the username portion and the
 entire email string is surrounded by bold tags?

 Thanks

 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318678
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Regex help

2009-01-30 Thread Nathan Strutz

Pat,

Few tips.
If you're going to say b or strong with (b|strong), it's a few less
chars to just do (b|strong).
Instead of [a-zA-Z0-9_%+-], you can get by with [\w%+-], oh, and add a
period to one of those in case there is more than 1 in the string, then
there's no need for that extra param and possible dot you have.
reFindNoCase runs a fair amount slower than reFind. Don't ask my why, but
benchmark it yourself.

The updated regex could look a little more like:

(b|strong)[\w%+-]*\.[\w\.%+...@[\w\.-]*[a-za-z]{2,5}/(b|strong)

nathan strutz
[Blog and Family @ http://www.dopefly.com/]
[AZCFUG Manager @ http://www.azcfug.org/]



On Fri, Jan 30, 2009 at 10:54 AM, Patrick Santora patwe...@gmail.comwrote:


 This pattern should account for strong as well now:
 cfset email =

 refindNoCase((b|strong)(([A-Z0-9_%+-]*\.)+[a-z0-9_%+...@[a-z0-9.-]+\.[a-z]{2,4})(\/b|\/strong),
 string, 1, true )/

 Just amend the tag you want to wrap around the email (b|strong) and
 (\/b|\/strong) as shown above. Pipes are the or operators.

 -Pat

 On Fri, Jan 30, 2009 at 8:08 AM, Dean Lawrence dean...@gmail.com wrote:

 
  Hi All,
 
  Can anyone help me with a particular regex patten? I am trying to find
 any
  email address that has at least one dot in the username portion and the
  entire email string is surrounded by bold tags?
 
  Thanks
 
 

 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318686
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Regex help

2009-01-30 Thread Patrick Santora

Thanks for the tips. Always helpful! I built this quickly as I only had a
few minutes. I've worked with regex for a bit.

Either way it looks as though any of these examples will work.

Thanks,
-Pat

On Fri, Jan 30, 2009 at 3:49 PM, Nathan Strutz str...@gmail.com wrote:


 Pat,

 Few tips.
 If you're going to say b or strong with (b|strong), it's a few less
 chars to just do (b|strong).
 Instead of [a-zA-Z0-9_%+-], you can get by with [\w%+-], oh, and add a
 period to one of those in case there is more than 1 in the string, then
 there's no need for that extra param and possible dot you have.
 reFindNoCase runs a fair amount slower than reFind. Don't ask my why, but
 benchmark it yourself.

 The updated regex could look a little more like:

 (b|strong)[\w%+-]*\.[\w\.%+...@[\w\.-]*[a-za-z]{2,5}/(b|strong)

 nathan strutz
 [Blog and Family @ http://www.dopefly.com/]
 [AZCFUG Manager @ http://www.azcfug.org/]



 On Fri, Jan 30, 2009 at 10:54 AM, Patrick Santora patwe...@gmail.com
 wrote:

 
  This pattern should account for strong as well now:
  cfset email =
 
 
 refindNoCase((b|strong)(([A-Z0-9_%+-]*\.)+[a-z0-9_%+...@[a-z0-9.-]+\.[a-z]{2,4})(\/b|\/strong),
  string, 1, true )/
 
  Just amend the tag you want to wrap around the email (b|strong) and
  (\/b|\/strong) as shown above. Pipes are the or operators.
 
  -Pat
 
  On Fri, Jan 30, 2009 at 8:08 AM, Dean Lawrence dean...@gmail.com
 wrote:
 
  
   Hi All,
  
   Can anyone help me with a particular regex patten? I am trying to find
  any
   email address that has at least one dot in the username portion and the
   entire email string is surrounded by bold tags?
  
   Thanks
  
  
 
 

 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318688
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Regex help

2009-01-30 Thread Peter Boughton

Ok, firstly a slight semantics rant:
Strong and Bold are NOT synonymous - just because the default styling for the 
Strong tag is bold does not mean that they are interchangeable.

Now that's out of the way, onto the regex side of things - your pattern will 
match this:
bsome.th...@where.ever/strong


When matching opening/closing tags, you need to ensure that they both match, 
like so:

(tag1|tag2|tag3).../\1

The \1 is a backreference to the first group in the expression - often people 
use these in replacements, but they work in the main expression too!


Another potential bug with the expression - what about this:
b style=color:red;some.th...@where.ever/b

To match attributes, the simple way is to do:

(tag1|tag2|tag3)[^]+.../\1


For the actual email expression... well, true email regex is a nightmare, but a 
few obvious things:

 - [A-Z]{2,4} is not valid - what about .museum and others.
 - u...@127.0.0.1 and u...@localhost are both valid formats

If this is matching, rather than validating, best to just use a simple 
catch-all style, along the lines of:

[^@ ]+\.[^@ ]...@[^@ ]+?

(I'm not entirely happy with that, but too tired to come up with better.
Hopefully it gives the main idea - we don't need/want to be over-specific here.)


So, keeping in mind that B != STRONG, but putting all the above together, we 
get:

(b|strong)[^]+[^@ ]+\.[^@ ]...@[^@ ]+?/\1

which can be plugged into a refind/rematch as required. 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318690
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Regex help

2009-01-30 Thread Peter Boughton

reFindNoCase runs a fair amount slower than reFind.

Have you compared it against using inline case-insensitive flag, i.e:
refind( '(?i)regex' , text )

Would be interesting to know if that is any faster/slower than refindnocase. 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318693
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Regex help - matching invalid xhtml

2008-12-03 Thread Dominic Watson
Any reason not to be using the XHTML parsers out there on the produced output?

Dominic

2008/12/3 Will Tomlinson [EMAIL PROTECTED]:
 I guess it'd be cool if I were to use (meta|input|img) in there, to flag 
 single tags without the trailing [space]/

 Will

 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316174
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Regex help - matching invalid xhtml

2008-12-03 Thread Dominic Watson
NVM, of course there is eh, you can auto fix them with CF right...

Dominic

2008/12/3 Dominic Watson [EMAIL PROTECTED]:
 Any reason not to be using the XHTML parsers out there on the produced output?

 Dominic

 2008/12/3 Will Tomlinson [EMAIL PROTECTED]:
 I guess it'd be cool if I were to use (meta|input|img) in there, to flag 
 single tags without the trailing [space]/

 Will

 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316175
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Regex help - matching invalid xhtml

2008-12-03 Thread Andy Matthews
Actually, both of your examples are invalid according to the W3C which
states that all attributes must be quoted:
http://www.w3.org/TR/2002/REC-xhtml1-20020801/#h-4.4

The space before the trailing / is irrelevant, it can appear or not without
penalty:
http://www.w3.org/TR/2002/REC-xhtml1-20020801/#h-4.6

It is however a good idea to put a space before the / for readability.


andy

-Original Message-
From: Will Tomlinson [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 02, 2008 10:07 PM
To: cf-talk
Subject: Re: Regex help - matching invalid xhtml

I guess it'd be cool if I were to use (meta|input|img) in there, to flag
single tags without the trailing [space]/

Will 



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316186
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Regex help - matching invalid xhtml

2008-12-03 Thread Will Tomlinson
Actually, both of your examples are invalid according to the W3C which
states that all attributes must be quoted:
http://www.w3.org/TR/2002/REC-xhtml1-20020801/#h-4.4

The value of that variable output DOES contain quotes. I just need my regex to 
do what is required by my company. 

Well, I need to match what's considered to be invalid at my place of work. :)

Thanks,
Will 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316190
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Regex help - matching invalid xhtml

2008-12-03 Thread Andy Matthews
Gotcha.

:) 

-Original Message-
From: Will Tomlinson [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 03, 2008 9:04 AM
To: cf-talk
Subject: Re: Regex help - matching invalid xhtml

Actually, both of your examples are invalid according to the W3C 
which states that all attributes must be quoted:
http://www.w3.org/TR/2002/REC-xhtml1-20020801/#h-4.4

The value of that variable output DOES contain quotes. I just need my regex
to do what is required by my company. 

Well, I need to match what's considered to be invalid at my place of work.
:)

Thanks,
Will 



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316194
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Regex help - matching invalid xhtml

2008-12-02 Thread Will Tomlinson
I guess it'd be cool if I were to use (meta|input|img) in there, to flag single 
tags without the trailing [space]/

Will 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316137
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Regex help

2008-06-30 Thread Will Tomlinson
I can do just one part, but if I try to make it an either/or with a pipe, it 
throws me off. This works. 

cfset str = 'if (someKey in struct){'

cfset re = 'if\s+\('

cfoutput#reFindNoCase(re, str)#/cfoutput

How do I add the brackets and so it'll catch one or the other?

Thanks much,
Will 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308326
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Regex help

2008-06-30 Thread Sonny Savage
This RegEx will tell you if there are any spaces between the parenthesis:
if\s*\(.*\s+.*\)\s*\{

Edward A Savage Jr - Sonny
Senior Software Engineer
Creditdiscovery, LLC
An appeaser is one who feeds a crocodile, hoping it will eat him last. ~
Sir Winston Churchill

On Mon, Jun 30, 2008 at 2:58 PM, Will Tomlinson [EMAIL PROTECTED] wrote:

 I can do just one part, but if I try to make it an either/or with a pipe,
 it throws me off. This works.

 cfset str = 'if (someKey in struct){'

 cfset re = 'if\s+\('

 cfoutput#reFindNoCase(re, str)#/cfoutput

 How do I add the brackets and so it'll catch one or the other?

 Thanks much,
 Will

 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308328
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Regex help (Solved)

2008-06-30 Thread Will Tomlinson
Ok, my example was wrong anyway. lol!

I figured it out. This worked:

cfset str = 'if(someVar gt 0){'

cfset re = 'if\s+\(|\)\s+\{'

cfoutput#reFindNoCase(re, str)#/cfoutput 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308329
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Regex help

2008-06-30 Thread Sonny Savage
It just occurred to me that the any pattern matches should be non-greedy for
matching accuracy:
if\s*\(.*?\s+.*?\)\s*\{

On Mon, Jun 30, 2008 at 3:10 PM, Sonny Savage [EMAIL PROTECTED] wrote:

 This RegEx will tell you if there are any spaces between the parenthesis:
 if\s*\(.*\s+.*\)\s*\{

 Edward A Savage Jr - Sonny
 Senior Software Engineer
 Creditdiscovery, LLC
 An appeaser is one who feeds a crocodile, hoping it will eat him last. ~
 Sir Winston Churchill

 On Mon, Jun 30, 2008 at 2:58 PM, Will Tomlinson [EMAIL PROTECTED]
 wrote:

 I can do just one part, but if I try to make it an either/or with a pipe,
 it throws me off. This works.

 cfset str = 'if (someKey in struct){'

 cfset re = 'if\s+\('

 cfoutput#reFindNoCase(re, str)#/cfoutput

 How do I add the brackets and so it'll catch one or the other?

 Thanks much,
 Will

 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308330
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Regex help

2008-06-30 Thread Will Tomlinson
This RegEx will tell you if there are any spaces between the parenthesis:
if\s*\(.*\s+.*\)\s*\{



I posted a solved post but don't see it yet. 

I can't use * because that flags it even if there's 0 spaces. I used + and it 
works. 

Thanks sonny!

Will 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308334
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Regex help

2008-06-30 Thread Sonny Savage
Yeah... my solution has a '+' match on the space.  Glad you solved it!

On Mon, Jun 30, 2008 at 3:20 PM, Will Tomlinson [EMAIL PROTECTED] wrote:

 This RegEx will tell you if there are any spaces between the parenthesis:
 if\s*\(.*\s+.*\)\s*\{
 


 I posted a solved post but don't see it yet.

 I can't use * because that flags it even if there's 0 spaces. I used + and
 it works.

 Thanks sonny!

 Will

 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308335
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: regex help

2008-02-18 Thread cf coder
Thank you Jason, Craig and Bobby for your help which is greatly appreciated. 
However this is not quite what I want. I do apologise for changing my original 
requirement.

I'll try to explain.

I want to read the contents of all the .cfm files in a directory and return all 
the href tags with the productID= text in the query string, ex:
a href=somesite.com/index.cfm?action=getproductID=1test/a

When I did a search in the codebase for productID=, I found there were few 
a tags which looked like this:

a title=Find out more href=somesite.com/index.cfm?action=getproductID=1 
onclick=somefunction()img src=exmaple.gif alt=some alt

I want the regular expression to be able to match the above example as well.

If it is not too much of an inconvenience can you please send me the revised 
code?

Regard,
cfcoder

 EDIT:
 
 The regex should be this one instead.  The one above would not handle 
 any thing between the href= and the closing . 
 
(a[^]*href=[ 
'](([^']*)?([^']ProductID=?([^']*)[^']*))['][^]*([^]*)\/a) 


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299255
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: regex help

2008-02-18 Thread cf coder
Actually, please ignore my last message. I have got it to work:
reFindNoCase(a[ ][\w -~]+productID=[ -~]+/a,inputString, pos)

Thank you everybdoy for your help.

Regards,

cfcoder

 Thank you Jason, Craig and Bobby for your help which is greatly 
 appreciated. However this is not quite what I want. I do apologise for 
 changing my original requirement.
 
 I'll try to explain.
 
 I want to read the contents of all the .cfm files in a directory and 
 return all the href tags with the productID= text in the query 
 string, ex:
 a href=somesite.com/index.cfm?action=getproductID=1test/a
 
 When I did a search in the codebase for productID=, I found there 
 were few a tags which looked like this:
 
 a title=Find out more href=somesite.com/index.
 cfm?action=getproductID=1 onclick=somefunction()img src=exmaple.
 gif alt=some alt
 
 I want the regular expression to be able to match the above example as 
 well.
 
 If it is not too much of an inconvenience can you please send me the 
 revised code?
 
 Regard,
 cfcoder
 
  EDIT:
  
  The regex should be this one instead.  The one above would not 
 handle 
  any thing between the href= and the closing . 
  
 (a[^]*href=[ 
 '](([^']*)?([^']ProductID=?([^']*)[^']*))['][^]*([^]*)\/a) 
 


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299256
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: regex help

2008-02-18 Thread Jeff Price
Two questions:

1) What does the -~ do inside the []? I haven't seen that syntax before or I'm 
incredibly rusty with my regex. 

2) Is your regex minimally matching? I had always thought CF was a greedy match?

Thanks,
Jeff

Actually, please ignore my last message. I have got it to work:
reFindNoCase(a[ ][\w -~]+productID=[ -~]+/a,inputString, pos)

Thank you everybdoy for your help.

Regards,

cfcoder 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299257
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: regex help

2008-02-18 Thread Craigsell
That range matches all the characters in the ascii chart except the control 
characters.  Same as saying give me all the Ascii characters from Ascii 32 
(space) to Ascii 126 (_).  I thought it was a bit more restrictive than the 
dot operator.

 In the [\w -~], the -w is actually redundant since \w stands for 
[a-zA-Z0-9].

Another improvement would be to account for variable spacers using 
reFindNoCase(a +[ -~]+productID=[ -~]+/a,inputString, pos).

As far as I know, greediness is not restricted to CF but can be found in any 
regular expression. From what I've heard CF8 deals with regexp differently 
than CF7.  For example, I think CF8 will return an array of matches.

In looking at this again, I'd say it is greedy because of the [ -~]+ pattern 
(similar to using .+) .  I think using reFindNoCase(a 
+?[ -~]+?productID=[ -~]+?/a,inputString, pos) will force minimal 
matching but I'd have to run some tests with it to be sure.

Any regexp experts care to weigh in?  I don't use them enough to be an 
authority and would like to learn more 


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299261
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: regex help

2008-02-18 Thread Jeff Price
LOL! And here I was thinking the ~ was some kind of special character! 
Sometimes if it looks like a tilde it's just a tilde :)

Thanks!

That range matches all the characters in the ascii chart except the control 
characters.  Same as saying give me all the Ascii characters from Ascii 32 
(space) to Ascii 126 (_).  I thought it was a bit more restrictive than the 
dot operator.


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299263
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: regex help

2008-02-15 Thread Adrian Lynch
If you don't manage to get what you're after. Just loop over the array and
look for the string.

Adrian

-Original Message-
From: cf coder
Sent: 15 February 2008 17:11
To: CF-Talk
Subject: regex help


Hello everybody,

I need some help with regular expressions.

I'm trying to write a reqular expression that will return all the links on a
page that contain a string in the query string.

I found a UDF on cflib that returns a list of all the anchor tags on a page
but I want to only return all href tags that contain the word ProductID in
the query string ex:
a href=somesite.com/index.cfm?action=getproductID=1test/a

Here is the udf, that returns all the links on the page.

function hrefsToList(inputString) {
var pos=1;
var tmp=0;
var linklist = ;
var delimiter = ,;
var endpos = ;

if(arrayLen(arguments) gte 2) delimiter = arguments[2];

while(1) {
tmp = reFindNoCase(a[^]*[^]*/a, inputString, pos);
if(tmp) {
pos = tmp;
endpos = findNoCase(/a, inputString, pos)+4;
linkList = listAppend(linkList, mid(inputString, pos, 
endpos-pos),
delimiter);
pos = endpos;
}
else break;
}

return linkList;
}

Can someone please show me how to change the modify expression to return
what I've explained above please?

Thanks,
cfcoder


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299084
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: regex help

2008-02-15 Thread cf coder
pardon me saying this but it looks very complicated. I rather just write a 
regex that will do this effortlessley.

Regards,
cfcoder

I need some help with regular expressions.

What you need is the kind of requirement I made CF_REextract for.
See http://www.contentbox.com/claude/customtags/REextract/testREextract.cfm 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299089
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: regex help

2008-02-15 Thread Craigsell
If tmp  0, it's there!

reFindNoCase(a[ ]+href[ -~]+productID[ -~]+/a,inputString, pos)

Warren Koch

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299090
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: regex help

2008-02-15 Thread Craigsell
Sorry -- you only wanted it if productid was in a query string.

Try this

reFindNoCase(a[ ]+href[ -~]+\?[ -~]+productID=[ -~]+/a,inputString, 
pos)


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299093
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: regex help

2008-02-15 Thread Gerald Guido
I use the QuickREx plugin for Eclipes. Very handy.  RegEx's make my brain
hurt.

http://www.bastian-bergerhoff.com/eclipse/features/web/QuickREx/toc.html

There is a stand alone version

http://www.bastian-bergerhoff.com/eclipse/features/web/QuickREx/standalone.html



-- 
All you need in this life is ignorance and confidence; then success is
sure.
- Mark Twain


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299091
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: regex help

2008-02-15 Thread Jason Morgan
EDIT:

The regex should be this one instead.  The one above would not handle any thing 
between the href= and the closing . 

(a[^]*href=['](([^']*)?([^']ProductID=?([^']*)[^']*))['][^]*([^]*)\/a)
 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299105
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: regex help

2008-02-15 Thread Jason Morgan
Hi here is a regex that should do the job.  It does a little more that you are 
asking for.  I felt like playing around with the regex.  

cfsavecontent 
variable=regex(a[^]*href=['](([^']*)?([^']ProductID=?([^']*)[^']*))[']([^]*)\/a)/cfsavecontent


cfsavecontent variable=text
a style=mystyle:as; href=index.cfm?x=1ProductID=5y=2I am link 1/abr 
/

a href=index.cfm?x=1z=5y=2I am link 2/abr /

a href=index.cfm?ProductID=1z=5y=2I am link 3/abr /

a href=index.cfm?x=1z=5ProductID=2I am link 4/abr /

a href=index.cfm?x=1ProductIDy=2I am link 5/abr /

/cfsavecontent

fieldset
legendText/legend

cfoutput#text#/cfoutput

/fieldset

cfset result = ReFindNoCase(regex,text,1,true) /
cfset resultArray = ArrayNew(1) /


cfloop condition=#result[len][1]# neq 0
cfset info = StructNew() /
cfset info.match = Mid(text,result[pos][2], result[len][2]) /
cfset info.href= Mid(text,result[pos][3], result[len][3]) /
cfset info.hrefbeforeProductID= Mid(text,result[pos][4], 
result[len][4]) /
cfset info.hreffromProductIDPlus = Mid(text,result[pos][5], 
result[len][5]) /
cfset info.ProductID = Mid(text,result[pos][6], result[len][6]) /
cfset info.LinkText = Mid(text,result[pos][7], result[len][7]) /
cfset ArrayAppend(resultArray, info) /
cfset text = removeChars(text,result[pos][1], result[len][1]) /

cfset result = ReFindNoCase(regex,text,1,true) /
/cfloop

cfdump var=#resultArray#


Thanks, 
Jason Morgan. 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299100
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: regex help

2008-02-15 Thread cf coder
I would prefer the regular expression to do this. Can you show me how to do 
what you are suggesting please?

If you don't manage to get what you're after. Just loop over the array and
look for the string.

Adrian

Hello everybody,

I need some help with regular expressions.

I'm trying to write a reqular expression that will return all the links on a
page that contain a string in the query string.

I found a UDF on cflib that returns a list of all the anchor tags on a page
but I want to only return all href tags that contain the word ProductID in
the query string ex:
a href=somesite.com/index.cfm?action=getproductID=1test/a

Here is the udf, that returns all the links on the page.

function hrefsToList(inputString) {
   var pos=1;
   var tmp=0;
   var linklist = ;
   var delimiter = ,;
   var endpos = ;

   if(arrayLen(arguments) gte 2) delimiter = arguments[2];

   while(1) {
   tmp = reFindNoCase(a[^]*[^]*/a, inputString, pos);
   if(tmp) {
   pos = tmp;
   endpos = findNoCase(/a, inputString, pos)+4;
   linkList = listAppend(linkList, mid(inputString, pos, 
 endpos-pos),
delimiter);
   pos = endpos;
   }
   else break;
   }

   return linkList;
}

Can someone please show me how to change the modify expression to return
what I've explained above please?

Thanks,
cfcoder 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299085
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: regex help

2008-02-15 Thread Claude Schneegans
 I need some help with regular expressions.

What you need is the kind of requirement I made CF_REextract for.
See http://www.contentbox.com/claude/customtags/REextract/testREextract.cfm

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299086
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


  1   2   3   4   5   >