Another RegEx question...

2007-12-20 Thread Che Vilnonis
In a sea of data, I need to pull the first image tag. It looks like this... img src=http://images.craigslist.org/01010001150701030720071219cd6f3ea36b5b712d 2f00d0d9.jpg I am using... cfset imageLink = REReplaceNoCase(cfhttp.fileContent, img[^]+([a-z0-9_]\.(?:jpg|jpeg|gif|png))[^]*, , ONE) But it

Re: Another RegEx question...

2007-12-20 Thread Todd
listLast(URL,'/') ? You're just complicating something simple with Regex here in this case. On Dec 20, 2007 2:55 PM, Che Vilnonis [EMAIL PROTECTED] wrote: In a sea of data, I need to pull the first image tag. It looks like this... img src=

RE: Another RegEx question...

2007-12-20 Thread Che Vilnonis
PROTECTED] Sent: Thursday, December 20, 2007 2:58 PM To: CF-Talk Subject: Re: Another RegEx question... listLast(URL,'/') ? You're just complicating something simple with Regex here in this case. On Dec 20, 2007 2:55 PM, Che Vilnonis [EMAIL PROTECTED] wrote: In a sea of data, I need to pull the first

Re: Another RegEx question...

2007-12-20 Thread Ben Doom
The first thing I see is that you are only allowing for single-character names. You don't have a + or * (+ would be better) after [a-z0-9_]. There may be more, but that's what I see at first glance. --Ben Doom Che Vilnonis wrote: In a sea of data, I need to pull the first image tag. It

Re: Another RegEx question...

2007-12-20 Thread Josh Nathanson
I think you need ReFindNoCase, otherwise it will return empty string. -- Josh - Original Message - From: Todd [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Thursday, December 20, 2007 11:58 AM Subject: Re: Another RegEx question... listLast(URL,'/') ? You're just

Re: Another RegEx question...

2007-12-20 Thread Claude Schneegans
I am cfhttp-ing a page and searching for the first image tag. This is a job for CF_REextract : http://www.contentbox.com/claude/customtags/REextract/testREextract.cfm You can even test it on line : 1) set INPUTMODE = to http 2) go to

RE: Another RegEx question...

2007-12-20 Thread Che Vilnonis
Claude, that brings back the javascript script tag. Neat custom tag, I just want the RegEx though. -Original Message- From: Claude Schneegans [mailto:[EMAIL PROTECTED] Sent: Thursday, December 20, 2007 3:36 PM To: CF-Talk Subject: Re: Another RegEx question... I am cfhttp-ing a page

Re: Another RegEx question...

2007-12-20 Thread Claude Schneegans
Claude, that brings back the javascript script tag Ah ok, then you have to include the img tag in the RE1 expression. I just want the RegEx though. I wrote this tag because it is sometimes much easier to find what's between two very simple expressions than to describe what you want in only

Re: Another RegEx question...

2007-12-20 Thread s. isaac dealey
cfset imageLink = REReplaceNoCase(cfhttp.fileContent, img[^]+([a-z0-9_]\.(?:jpg|jpeg|gif|png))[^]*, , ONE) In addition to Ben's comment, it doesn't look like you're finding the beginning of the src attribute, see: img[^]+ and then straight into the regex for the url ... so there's no mention

Re: This is a good one - another Regex question

2007-07-24 Thread Jide Aliu
Jide, why do you want to do this again?? What precisely are you gaining by moving the closing paragraph tag outside the UL? Hi Mark, I've been away for a couple of days, I've just seen your post. The long and short of it is that we have a client that has some sort of data feed process that

Re: This is a good one - another Regex question

2007-07-23 Thread Mark Henderson
Claude Schneegans wrote: IMO, the format you are trying to modify is by far more correct than the result you are trying to attempt. Agreed. And the question, although once posed, still beckons - Jide, why do you want to do this again?? What precisely are you gaining by moving the closing

Re: This is a good one - another Regex question

2007-07-23 Thread Mark Henderson
Jide Aliu wrote: Thanks for your reply Claude. I know that formatting wise it's madness to have p tags round ul tag, but the problem we are having is that we are suppplying xml data to a vendor for some reason their system won't accept ul listing without p tags round them. That is my

Re: This is a good one - another Regex question

2007-07-21 Thread Jide Aliu
Thanks for your help Claude, it has really open my eyes to Regex. Not sure what it can't do as far as text manipulation goes :-) ~| ColdFusion MX7 by Adobe® Dyncamically transform webcontent into Adobe PDF with new ColdFusion

Re: This is a good one - another Regex question

2007-07-21 Thread Claude Schneegans
Not sure what it can't do as far as text manipulation goes Not really sure about something regexp can't do. The problem is generally to find the right one ;-) -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm

Re: This is a good one - another Regex question

2007-07-20 Thread Jide Aliu
Thanks for your reply Claude. I know that formatting wise it's madness to have p tags round ul tag, but the problem we are having is that we are suppplying xml data to a vendor for some reason their system won't accept ul listing without p tags round them. That is my dilema. I'll have a look at

Re: This is a good one - another Regex question

2007-07-20 Thread Jide Aliu
Incidentally Claude, how would CF_Extract work in solving the problem. If I'm 100% sure that it'll work, I'll get it now! Thanks again ~| CF 8 – Scorpio beta now available, easily build great internet experiences – Try it

Re: This is a good one - another Regex question

2007-07-20 Thread Claude Schneegans
Incidentally Claude, how would CF_Extract work in solving the problem. I cannot be 100% sure myself if I don't have a sample of the file and the work to do actually, but apparently your problem it a parsing issue, and I've designed this tag to help to solve parsing problems. The basic

Re: This is a good one - another Regex question

2007-07-20 Thread Jide Aliu
I cannot be 100% sure myself if I don't have a sample of the file and the work to do actually pstrongJedi Knight? Big paragraph sometime and large chunk of text sometimes /strong/p ul lisfsdfsdfs dfsdfsdfsdf/li lisdfsddfsdf sdfsdf/li lisdfsddfsdf sdfsdf/li /ul Honestly this is

Re: This is a good one - another Regex question

2007-07-20 Thread Claude Schneegans
If the whole file is like this, henestly you don't really need CF_REextract for this. 1º replace all occurences of /p[[:space:]]ul by #chr(13)##chr(10)#ul 2º replace all /ul with /ul#chr(13)##chr(10)#/p You don't even need regexp for 2º Now, if you have UL blocs with no preceding P, or

Re: This is a good one - another Regex question

2007-07-20 Thread Jide Aliu
Thanks Claude - I'll try this and let you know if it works. ~| Create Web Applications With ColdFusion MX7 Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive:

Re: This is a good one - another Regex question

2007-07-20 Thread Jide Aliu
Hi Claude - I tried the implementation you suggested, the second half worked fine all/ul are replaced by /ul/p but absolutely nothing happened the top half the opening pblah blah/p ulsdfsd remains the same. Am I doing something wrong? Please see the code below cfset formatText=

Re: This is a good one - another Regex question

2007-07-20 Thread Ben Doom
You need an asterisk after [[:space:]]. Try that on for size. --Ben Doom Jide Aliu wrote: Hi Claude - I tried the implementation you suggested, the second half worked fine all/ul are replaced by /ul/p but absolutely nothing happened the top half the opening pblah blah/p ulsdfsd remains the

Re: This is a good one - another Regex question

2007-07-20 Thread Jide Aliu
You need an asterisk after [[:space:]]. Fantastic dude! That did the trick. Thanks, I'm off now to drop everything off into an xml document. ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 Flex 2

Re: This is a good one - another Regex question

2007-07-20 Thread Claude Schneegans
cfset formatText= rePlace(rawText, /p[[:space:]]ul, #chr(13)##chr(10)#ul,ALL) This one uses a regexp, so you should rather use REReplace() cfset formatText= REreplace(rawText, /p[[:space:]]ul, #chr(13)##chr(10)#ul,ALL) -- ___ REUSE CODE! Use custom tags;

Re: This is a good one - another Regex question

2007-07-20 Thread Claude Schneegans
You need an asterisk after [[:space:]] Also. ;-) -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks.

This is a good one - another Regex question

2007-07-19 Thread Jide Aliu
I have a body of text, within that text are random ul tags preceded by ptext/p, example below; pBody of text loads of it, sometimes just a one liner and it ends here/p ul liblurb of text one/li liblurb of text two/li liblurb of text three/li /ul pAnother of body text here/p ul liNew list

Re: This is a good one - another Regex question

2007-07-19 Thread Jide Aliu
Sorry just a quick correction below, the p tag must always encapsulate the next piece of ul tag just after it and closes at the end of the /ul/ptag; pBody of text loads of it, sometimes just a one liner and it ends here ul liblurb of text one/li liblurb of text two/li liblurb of

Re: This is a good one - another Regex question

2007-07-19 Thread Christopher Jordan
You know who you ought to ask about regex stuff is my man Steven Levithan over at Flagrant Badassery http://blog.stevenlevithan.com/. The dude is in love with regular expressions. Chris http://blog.stevenlevithan.com/On 7/19/07, Jide Aliu [EMAIL PROTECTED] wrote: I have a body of text, within

Re: This is a good one - another Regex question

2007-07-19 Thread Claude Schneegans
the p tag must go round the ul tags like so Sorry, but I don't really see the point here: The P tag is supposed to be applied to a paragraph. The UL and LI break that paragraph anyway, so that, unless the closing /P is right after the end of the paragraph, its presence after the closing /UL is

Yet another regex question

2007-05-16 Thread Peterson, Chris
I am trying to write a regex for IsapiRewrite4. I would like any url that is directly to the root (ie www.site.com) or to ( www.site.com/index.cfm ) with 3 required paramaters after it, and additional paramaters possibly. So: www.site.com/user/user/list/ would change to

Re: Yet another regex question

2007-05-16 Thread Jon Clausen
Chris, Check out Coldcourse (http://coldcourse.riaforge.com) It has the IsapiRewrite4 .ini file in there and allows you to specify a controller.delimiter which should work for your dot notation for event handlers. You can also specify courses manually which will allow you to make

RE: Yet another regex question

2007-05-16 Thread Peterson, Chris
-Original Message- From: Jon Clausen [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 16, 2007 2:52 PM To: CF-Talk Subject: Re: Yet another regex question Chris, Check out Coldcourse (http://coldcourse.riaforge.com) It has the IsapiRewrite4 .ini file in there and allows you to specify

Re: Yet another regex question

2007-05-16 Thread Jon Clausen
, 2007 2:52 PM To: CF-Talk Subject: Re: Yet another regex question Chris, Check out Coldcourse (http://coldcourse.riaforge.com) It has the IsapiRewrite4 .ini file in there and allows you to specify a controller.delimiter which should work for your dot notation for event handlers. You can

Re: OT: Yet another regex question

2005-10-27 Thread Ben Doom
No pressure, though. :-\ --Ben Bobby Hartsfield wrote: Yeah, I realize he specifically said or any CF5 solution now. But as long as we have you around...no worries in the RegEx department :) ..:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com

RE: OT: Yet another regex question

2005-10-27 Thread Bobby Hartsfield
With great power comes great responsibility :^p ..:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Ben Doom [mailto:[EMAIL PROTECTED] Sent: Thursday, October 27, 2005 10:28 AM To: CF-Talk Subject: Re: OT: Yet another regex question

OT: Yet another regex question

2005-10-26 Thread Dave Francis
Hi, Sorry for OT, but stumped. I need a regex (or any CF5 solution) to change all uuid's within a txt file to uppercase. They are all in quotes and preceded by id=. ie. id=38d4db48-7a05-491a-b258-675ddb02fd0e Thanks in advance to all and any advice Dave

RE: Yet another regex question

2005-10-26 Thread Bobby Hartsfield
') ..:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Dave Francis [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 26, 2005 12:20 PM To: CF-Talk Subject: OT: Yet another regex question Hi, Sorry for OT, but stumped. I need a regex (or any CF5 solution) to change all

Re: OT: Yet another regex question

2005-10-26 Thread Ben Doom
Unfortunately, the CF5 regex engine is a bit lacking in some areas. You can find the string with this: id=[a-z0-9-]+ Please note that that captures the id= and quotes as well. At this point, you can either use the ReExtract function (found on CFLib.org) or extract the string manually.

RE: OT: Yet another regex question

2005-10-26 Thread Bobby Hartsfield
: Wednesday, October 26, 2005 1:46 PM To: CF-Talk Subject: Re: OT: Yet another regex question Unfortunately, the CF5 regex engine is a bit lacking in some areas. You can find the string with this: id=[a-z0-9-]+ Please note that that captures the id= and quotes as well. At this point, you can either

Re: OT: Yet another regex question

2005-10-26 Thread Ben Doom
Yeah, from 5 to 6 was a huge jump in RE usefulness. :-) This is why a great number of regex threads immediatly respond to the question with what CF version. --Ben Bobby Hartsfield wrote: Sorry about that. I wasn’t aware it was that much different between versions. Hope I didn't cause you

RE: OT: Yet another regex question

2005-10-26 Thread Bobby Hartsfield
Yeah, I realize he specifically said or any CF5 solution now. But as long as we have you around...no worries in the RegEx department :) ..:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -- No virus found in this outgoing message. Checked by AVG Free Edition. Version:

RE: Another RegEx question

2002-01-30 Thread Pascal Peters
[mailto:[EMAIL PROTECTED]] Sent: dinsdag 29 januari 2002 19:10 To: CF-Talk Subject: Another RegEx question I find myself needing to find all the HREF values on a given page. Regular Expressions are the answer, but I haven't nailed the pattern yet

Another RegEx question

2002-01-29 Thread Shawn Grover
I find myself needing to find all the HREF values on a given page. Regular Expressions are the answer, but I haven't nailed the pattern yet. Any help??? I've tried the following: \w+:\/\/[^/:]+:\d*?[^# ]* (\w+)://([^/:]+)(:\d+)?/(.*)[\s|] href=\S.*[\S|] They tend to give me more than

RE: Another RegEx question

2002-01-29 Thread Steve Oliver
, 2002 1:10 PM To: CF-Talk Subject: Another RegEx question I find myself needing to find all the HREF values on a given page. Regular Expressions are the answer, but I haven't nailed the pattern yet. Any help??? I've tried the following: \w+:\/\/[^/:]+:\d*?[^# ]* (\w+)://([^/:]+)(:\d

RE: Another RegEx question

2002-01-29 Thread Shawn Grover
: Tuesday, January 29, 2002 11:20 AM To: CF-Talk Subject: RE: Another RegEx question If you just want the value of href, do something like: Rereplacenocase(string, a href=([^]*), \1, ALL) __ steve oliver cresco technologies, inc. http://www.crescotech.com -Original Message

RE: Another RegEx question

2002-01-29 Thread Steve Oliver
://www.crescotech.com -Original Message- From: Shawn Grover [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 29, 2002 3:43 PM To: CF-Talk Subject: RE: Another RegEx question Thanks, but if I have an anchor tag in this format, it won't return the HREF alone a href=http://someplace.com