In that rereplace(), the \1 is a reference to the non-digit character found in front of a digit character. If you run the code above, you'll get:
(x1,x2,x3,x4,x5)
Which seems peachy, right? Just replace the 'x' with a '1' in the expression above and you're golden.
But... then you end up with this: <cfoutput>#rereplaceNoCase(myList, '([^\d])(\d)', '\11\2', 'all')#</cfoutput>
Which doesn't work because the regex engine is now looking for the 11th grouped reference instead of the first.
What I'm trying to say is... just use a loop :)
But I posted this out of curiosity. Any regex gurus know of a way to tell the regex engine to effectively break out of looking for a grouped reference? A way to say "\1 -and- 1 -and- \2" ?
On Wed, Nov 11, 2009 at 12:11 PM, Cheryl Novalis-Marine <cheryl@...> wrote:
Anyone
know if there is a cf function to update all the values in a list the same? I
know I can easily do this my looping over the list, but just wondering if there
is a function too that can do this.
For
example here is my list (1,2,3,4,5) and I want to insert a 1 in front of each
value so that this list is now (11,12,13,14,15).
Anyone know if there is a cf function to update all the values in a list the same? I know I can easily do this my looping over the list, but just wondering if...
All I can think of is a regular expression to prepend a '1' to any digit not preceded by another digit. But, it doesn't work. <cfset mylist = "(1,2,3,4,5)" />...
Why not something simpler, like this function listItemPrepend(list,str) { return reReplace(arguments.list, "(\w)+", "#arguments.str#\1", "all"); } nathan...
Well now you're just showing off :D (but that's very cool) :) ... -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But...
Hi, I am trying to write a test utility that gets a pdf file from a site and then stores it in a folder with the name of the file being #Now()# or in other...
coldfusionapps@...
Dec 7, 2009 2:13 pm
Can you send us the code you are currently using in the cffile? ... -- Alan Rother Adobe Certified Advanced ColdFusion MX 7 Developer Manager, Phoenix Cold...
the URL is changed below to my.url.com for security reasons. <cfhttp url="https://my.url.com/images/PDFQk1DcUFjOXg5d0tQenc.pdf" resolveurl="yes"/> <cffile...
coldfusionapps@...
Dec 7, 2009 5:25 pm
AHHH... I thought so <cfhttp url="https://my.url.com/images/PDFQk1DcUFjOXg5d0tQenc.pdf" resolveurl="yes" getasbinary="yes"/> I tested it on my server using...
http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00001609.htm To get a binary file...
Because my regex-fu is weak :) ... -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my ...
How about this? http://cflib.org/udf/ListElementPrepend nathan strutz [Blog and Family @ http://www.dopefly.com/] [AZCFUG Manager @ http://www.azcfug.org/] ...
But that's (technically) looping :) ... -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my...
Thanks guys. Was just curious. I wrote it with cfloop. I like to ask these types of questions because since I have been using CF for like 4 versions now...
Thanks Nate. That's still looping:) From: azcfug@yahoogroups.com [mailto:azcfug@yahoogroups.com] On Behalf Of Nathan Strutz Sent: Wednesday, November 11, 2009...
Hey, it's still looping, but it's already written, no brainwork necessary. nathan strutz [Blog and Family @ http://www.dopefly.com/] [AZCFUG Manager @...