However, when using REReplace your forgetting the 'scope' attribute which
lets you specify how many matches to replace. By specifying All you get
them all.
cfset NumbersOnly = ReReplace(Image12334blue1,[^\d],,All)
This replaces everything that is not a Digit - Regex in this case is
defining
Ops, I did that backwards...
reReplace(myString, [\D], , all)
On Fri, Nov 7, 2008 at 10:46 AM, Matt Quackenbush [EMAIL PROTECTED]wrote:
reReplace(myString, [^A-Za-z], , all)
~|
Adobe® ColdFusion® 8 software 8 is the
REReplace()
Adrian
-Original Message-
From: Chad Gray
Sent: 07 November 2008 16:44
To: cf-talk
Subject: strip alpha char
I have a list of file names and I only want the numbers in the file names.
I don't want any alpha characters.
I can use RE to find the numbers, but it get
Ah... REReplace... I only knew of REFind...
THANKS!
-Original Message-
From: Matt Quackenbush [mailto:[EMAIL PROTECTED]
Sent: Friday, November 07, 2008 11:50 AM
To: cf-talk
Subject: Re: strip alpha char
Ops, I did that backwards...
reReplace(myString, [\D], , all
String functions:
http://livedocs.adobe.com/coldfusion/8/htmldocs/functions-pt0_18.html#1099887
:-)
On Fri, Nov 7, 2008 at 10:57 AM, Chad Gray [EMAIL PROTECTED] wrote:
Ah... REReplace... I only knew of REFind...
THANKS!
There's also REMatch (new in CF8) which returns the actual string matched
instead of just the position of that string.
-Original Message-
From: Chad Gray [mailto:[EMAIL PROTECTED]
Sent: Friday, November 07, 2008 10:57 AM
To: cf-talk
Subject: RE: strip alpha char
Ah... REReplace... I
I have a list of file names and I only want the numbers in the file names. I
don't want any alpha characters.
I can use RE to find the numbers, but it get complicated to find the starting
position of the number and the ending of the numbers then using the mid
function to get the number.
Is
Is there some magic CF function to take strings like this an strip the
alpha character?
With CF8 (and equiv) there is a new rematch function, which would allow:
cfset NumbersOnly = rematch( 'Image12334blue' , '\d+' )/
Which is selecting the numbers rather than stripping the non-numbers.
reReplace(myString, [^A-Za-z], , all)
On Fri, Nov 7, 2008 at 10:44 AM, Chad Gray [EMAIL PROTECTED] wrote:
I have a list of file names and I only want the numbers in the file names.
I don't want any alpha characters.
I can use RE to find the numbers, but it get complicated to find the
9 matches
Mail list logo