I am sure there are some nice slick regular expressions to do this, but I
just simply do this a very dumbed down way.
cfset myVar = ReplaceNoCase(myVar , ,, ,, ALL)
cfset myVar = ReplaceNoCase(myVar , , ,, ALL)
cfset myVar = ReplaceNoCase(myVar , ,, ALL)
cfset myVar =
thanks for the reply, i actually just found a shortcut! i converted the string
to an array which removed any empty array elements, and then converted back to
a list and therefore deleted all the duplicate, and trailing commas
I am sure there are some nice slick regular expressions to do
try this:
cfset string = rereplace(rereplace(string, ,+$, ), ,+, ,, all)
Azadi
On 02/11/2010 20:34 , Richard White wrote:
Hi, i need to replace all repeating commas in a string with only one comma,
plus remove the trailing comma, have tried a few different routes
unsuccessfully and would
This will replace everything that is not alphanumeric with a dash:
ProductPageName = rereplace( Form.PageName , '\W' , '-' , 'All' )
However, the above will change this that to this---that, if you would
prefer a single dash in situations like this, you can simply do this:
ProductPageName =
There are 2 separate thing being done with that code.
1. Its replacing spaces with a -
2. Its removing a bunch of 'special' characters.
There really is no way to do this in one live of code. However, if
this is something you woudl need to use in more than one place, you
can easily put these
If you want it in one line, just combine them:
productPageName =
Replace(REReplace(FORM.pageName,[.*+?^${}()|[\]/\\],,All),
,-,All);
BTW, you don't the the #'s inside of a function unless the variable is
in quotes.
Thanks,
Eric Cobb
http://www.cfgears.com
Glyn Jackson wrote:
I am just
Makes sense, thanks you.
~|
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:327452
also, if you are replace all non alpha-numeric characters you can do
this:reReplace(arguments.txt,
'[^[:alnum:].]', '-', 'all');
~Mahcsig
On Wed, Oct 21, 2009 at 8:57 AM, Glyn Jackson glyn.jack...@newebia.co.ukwrote:
Makes sense, thanks you.
[q]
FileName = rereplace(FileName, '(?!\.[^.]*$)\W', '', 'all')
[/q]
well, that is just beautiful!
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic
hmm... i guess i forgot to paste in the rest of the code... here it is
in all its ugly gory:
cfset filename = rereplace(left(filename,
len(filename)-len(listlast(filename, .))-1), \W, , all) .
listlast(filename, .)
it may be eugh and ugly!, but it's a one-liner and takes care of .
inside
but it's a one-liner
So?
Unless you have a limited number of newlines, mindlessly shoving commands into
a single line is really dumb; it reduces readability and achieves nothing.
This is another thing that bugs me - people compressing code without thought -
having the right amount of
better then just do something like
rereplace(left(filename, len(filename)-len(listlast(filename, .)-1),
\W, , all)
Eugh. Ugly!
And doesn't restore the extension afterwards, so my-image-name.png would
become myimagename instead of myimagename.png.
My follow-up posted last night didn't show up. So, I'm re-doing it now.
Execellent, Peter, thank you very much.
I'll use
rereplace( FileName , '\W' , '' , 'all' )
On the extension stuff I have a way to address it.
Don
rereplace(foo, '[^\w]', '', 'all')
will replace any non-alphanumeric
rereplace(foo, '[^\w]', '', 'all')
will replace any non-alphanumeric character in 'foo' (assuming 'foo' is the
file name).
On Wed, Dec 10, 2008 at 1:41 PM, Don L [EMAIL PROTECTED] wrote:
Regular Expression gurus. How to use the REreplace function to remove
special characters including +, .
rereplace(foo, '[^\w]', '', 'all')
will replace any non-alphanumeric character in 'foo' (assuming 'foo' is the
file name).
On Wed, Dec 10, 2008 at 1:41 PM, D
Great. Thank you. I also found out that REreplace(str, [^a-zA-Z0-9],,all)
would achieve the same result but yours seems more elegant
rereplace(foo, '[^\w]', '', 'all')
will replace any non-alphanumeric character
No need to complicate things with an inverted character class.
\W is same as [^\w]
Also, this bugs me immensely:
assuming 'foo' is the file name
JUST USE THE VARIABLE FILENAME THEN!
So:
rereplace( FileName , '\W'
On Wed, Dec 10, 2008 at 3:02 PM, Peter Boughton [EMAIL PROTECTED] wrote:
rereplace(foo, '[^\w]', '', 'all')
will replace any non-alphanumeric character
No need to complicate things with an inverted character class.
\W is same as [^\w]
fair enough. good catch.
Also, this bugs me
Hmmm, another thought...
Don, when you say image file name, is there a file extension to worry about
(i.e. jpg/png/etc)
If so, you'll want to be doing something like this...
rereplace( FileName , '(png|jpg|gif|tif|bmp)$' , '.\0' )
after the initial replacement, to restore the dot that will
I also found out that REreplace(str, [^a-zA-Z0-9],
,all)
would achieve the same result but yours seems more elegant (which
seems to say just keep {words}), my CF env = cf8 or cf81 for Windows,
does your solution have any dependency?
No dependency. \W [^\w] and [^a-zA-Z0-9] will all work
Sorry, typo. :(
In CFML/rereplace it is treated as [a-zA-Z0-9_] (not the underscore).
That should say note rather than not.
Underscore is included in \w (and excluded from \W) which is not what some
people might expect/want.
better then just do something like
rereplace(left(filename, len(filename)-len(listlast(filename, .)-1),
\W, , all)
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Peter Boughton wrote:
Hmmm, another thought...
Don, when you say image file name, is there a file extension to worry about
we ultimately came up with this:
(?![/]#Variables.Word#)(\W)(#Variables.Word#)(\W)
The only downside that we found is if the word is at the very end or
beginning of the paragraph.
That's the \W bits you're using - they're wrong; you want a zero-width word
boundary, not a non-word character.
Thanks, I will try that out locally and make a note to apply it the next
time I am in there since I already initiated the push process to get the
changes into place.
On Fri, Nov 7, 2008 at 8:03 AM, Peter Boughton [EMAIL PROTECTED] wrote:
we ultimately came up with this:
That's the \W bits you're using - they're wrong; you want a
zero-width word boundary, not a non-word character.
Use \b(#Variables.Word#)\b and you wont need to do the workaround.
Thanks Peter... I'd never used word boundaries... so of course, they
don't occur to me when I go to write a
The \b actually did not work, it put the link within the first span element
but maybe was how I tested it. I tried: (?![/]sub)(\b)(sub)(\b) as
well as (?![/]sub)\b(sub)\b
On Fri, Nov 7, 2008 at 10:49 AM, s. isaac dealey [EMAIL PROTECTED] wrote:
That's the \W bits you're using - they're
The \b actually did not work, it put the link within the first span element
but maybe was how I tested it. I tried: (?![/]sub)(\b)(sub)(\b) as
well as (?![/]sub)\b(sub)\b
Ah, you need to change your \2 to \1 in your replace part.
Since the \b is zero-width, it looks like it wont populate a
I have been using REReplace to find key words or group of words within
paragraphs and if found to replace those with an HREF.
The following code works.
(I haven't yet decided whether it's entirely the best way though...)
cfset Content = ListToArray(Content,'')/
cfloop index=i from=1
Thanks Peter, I got to talking to Isaac Dealey this evening about this since
he had helped out a while back on this particular project. He mentioned
what I need is a lookahead in the regex. After a few tries this is what we
ultimately came up with this:
Not sure why you're using ReReplace, just use Replace. Characters like .
have special meanings in ReReplace.
On 04/05/07, Robert Rawlins - Think Blue
[EMAIL PROTECTED] wrote:
I'm trying to replace the .jpg file extension on in a string with .gif and
using the following regex.
cfset
Thanks Adrian,
Its working fine now.
Rob
-Original Message-
From: Adrian [mailto:[EMAIL PROTECTED]
Sent: 04 May 2007 16:01
To: CF-Talk
Subject: Re: ReReplace
Not sure why you're using ReReplace, just use Replace. Characters like .
have special meanings in ReReplace.
On 04/05/07
I think you want Replace(), not ReReplace(). ReReplace is trying to use a RegEx
to make the replacement, Replace will do the straight text match/replace.
I'm trying to replace the .jpg file extension on in a string with .gif and
using the following regex.
cfset LOCAL.New = 'D:\MediaStore\'
Change your regex to this
[[:space:],]
That should work.
On 11/29/06, Les Mizzell [EMAIL PROTECTED] wrote:
I don't know why, but I always get a headache when working with
ReReplace and RegEx stuff...
OK, I need to replace *all* spaces with a +:
REReplace
as far as i can tell, it -would- be two rereplace() statements.
you're looking to replace two elements with two different elements.
it would be different if, let's say you wanted to replace all spaces
and commas with a single element (either a space or nothing)...but
you're looking to do two
Oh shoot, sorry. I missed the requirement to change spaces to + and
commas to nothing.
replaceList may work as well. Although you can't use [:space:] in that case.
On 11/29/06, Charlie Griefer [EMAIL PROTECTED] wrote:
as far as i can tell, it -would- be two rereplace() statements.
you're
On 11/29/06, Charlie Griefer [EMAIL PROTECTED] wrote:
as far as i can tell, it -would- be two rereplace() statements.
I'm not as crazy as I thought then. Yup, using two statements works great...
cfset request.noSPACE =
REReplace(#mySTRING#,[[:space:]],+,ALL)
cfset request.myADDRESS =
One tip - your second statement isn't a regex. It would make more
sense to just use replace, not rereplace.
On 11/29/06, Les Mizzell [EMAIL PROTECTED] wrote:
On 11/29/06, Charlie Griefer [EMAIL PROTECTED] wrote:
as far as i can tell, it -would- be two rereplace() statements.
I'm not as
I just tried it and it works for me. Can you post the arguments.body for us
to take a look at the mail body?
...
Ben Nadel
Web Developer
Nylon Technology
6 West 14th Street
New York, NY 10011
212.691.1134
212.691.3477 fax
www.nylontechnology.com
Vote for Pedro
-Original
Barney Boisvert wrote:
REreplace is a CF function, not a MySQL function, which is why you're
getting the error. MySQL has a 'replace' function though. Something
like this should work:
UPDATE myDATE SET
textfield = replace(textfield, Õ,')
That gives a syntax error as well.
MySQL
OK, running the below directly in the database worked fine.
UPDATE `textfield` SET `Logline` = REPLACE(`textfield`,Õ,')
Can't get an equilivent Coldfusion query to work though. Ideas?
--
---
Les Mizzell
~|
Find
textfield = replace(textfield, 'Õ',''')
That errors as well
You cannot use the same character (single quote) as a string and its
delimiter in the same time.
Check wih the MySQL syntax for escaping single quotes.
Then you probabily need to use the preserveSingleQuotes() function in
the
REreplace is a CF function, not a MySQL function, which is why you're
getting the error. MySQL has a 'replace' function though. Something
like this should work:
UPDATE myDATE SET
textfield = replace(textfield, Õ,')
Rip out part of the table into a temp table to test against so you can
ensure
thank you pascal...
although, im not sure if im even going to travel down the path i was
originally thinking on this one...
either way, THANKS!
--
tony
Tony Weeg
macromedia certified coldfusion mx developer
email: tonyweeg [at] gmail [dot] com
blog: http://www.revolutionwebdesign.com/blog/
might be wrong)
Pascal
-Original Message-
From: Tony Weeg [mailto:[EMAIL PROTECTED]
Sent: 13 December 2004 22:31
To: CF-Talk
Subject: Re: reReplace()
i know how to use the reReplace to replace characters and stuff, but
what about removing special things, like cr + lf, can you do
so this reads:
reReplace(string,'#chr(10)#|#chr(13)#|#chr(32)#','','all'
replace all 10's 13's and 32's regardless of anything
is there a way to say, dont remove where you find a (couplet)
#chr(10)##chr(13)#
just where you find either that arent together?
--
tony
Tony Weeg
macromedia
rereplace(string ,(\s)[\1\s]+,\1all) Might that do the trick?
Thats gonna replace any space character that is followed by another
space character (or more) with just the first space char found...or
atleast tthats what I was goiong for not positive on the syntax and
nothing to check with ATM...
Just use #Chr(10)# inside the regex (in a set of brackets or alone) and
it'll be turned into it's ascii equivalent for use by the expression.
-Original Message-
From: Tony Weeg [mailto:[EMAIL PROTECTED]
Sent: Monday, December 13, 2004 4:31 PM
To: CF-Talk
Subject: Re: reReplace()
i
i know how to use the reReplace to replace characters and stuff, but
what about removing special things, like cr + lf, can you do that in
regex?
ben :) anyone...
thanks.
tony
On Mon, 13 Dec 2004 16:22:45 -0500, Tony Weeg [EMAIL PROTECTED] wrote:
hi there.
i need to remove all carriage
reReplace(string,'(#chr(10)##chr(13)#)|(#chr(10)#|#chr(13)#|#chr(32)#)','\1','all'
Tony Weeg wrote:
so this reads:
reReplace(string,'#chr(10)#|#chr(13)#|#chr(32)#','','all'
replace all 10's 13's and 32's regardless of anything
is there a way to say, dont remove where you find a
its a backreference.. to (#chr(10)##chr(13)#)
following page will explain better then I can.
http://www.regular-expressions.info/brackets.html
Tony Weeg wrote:
thank you umer...
now, what does the \1 mean in the 3rd parameter?
thanks.
tony
On Mon, 13 Dec 2004 19:02:10 -0500, Umer
thank you umer...
now, what does the \1 mean in the 3rd parameter?
thanks.
tony
On Mon, 13 Dec 2004 19:02:10 -0500, Umer Farooq [EMAIL PROTECTED] wrote:
reReplace(string,'(#chr(10)##chr(13)#)|(#chr(10)#|#chr(13)#|#chr(32)#)','\1','all'
Tony Weeg wrote:
so this reads:
I'm confused on a number of issues.
First, I don't know what characters you're referring to.But that's
tangental, anyway.
Second, I don't know why you need a regular _expression_.You could just
use a regular replace for each one:
string = replace(string, chr(123), chr(456), 'all')
where 123
I'm confused on a number of issues.
sorry ben but i dont know why u live in kentucky either HAHA jk ;)
First, I don't know what characters you're referring to.
http://www.asciitable.com./
i think im just getting mixed up on what value to use
for example for em do i use (in the chr()) em or 25 or
, 2004 1:45 PM
Subject: Re: rereplace ?
I'm confused on a number of issues.
sorry ben but i dont know why u live in kentucky either HAHA jk ;)
First, I don't know what characters you're referring to.
http://www.asciitable.com./
i think im just getting mixed up on what value to use
for example
I'm confused on a number of issues.
sorry ben but i dont know why u live in kentucky either HAHA jk ;)
My family lives here.Trust me, that's the *only* reason.Rural KY is
not that fun a place.
First, I don't know what characters you're referring to.
http://www.asciitable.com./
i think im just
Not directly, that I've ever been able to figure out.What I have done
(though it's kind of a pain) is to use refind to grab out the bits I
want, and do something like
string = left(string, pos[1] - 1) emailAntiSpam(mid(string, pos[1],
len[1])) right(string, pos[1]+len[1]+1, len(string));
Yeah, I've already got the UDF written, I was just thinking how nice
it would be if I could manipulate the backreference directly. It would
simplify the code a lot.
Thanks,
Jamie
On Thu, 05 Feb 2004 13:50:27 -0500, in cf-talk you wrote:
Not directly, that I've ever been able to figure out.What
Yeah you can use back references, it would be something like the following
Pseudo code:
your spam email = taco at coldfusionist.com
find (\.*)\sat\s(\.*)
replace with [EMAIL PROTECTED]
The regex needs adjustment, but it displays how the back references could do
the trick
Taco Fleur
That's not quite what I've got going on. Notice that while you used
backreferences, you didn't *process* them at all. (Maybe that's how I
should have phrased it: Is it possible to *process* backreferences
within REReplace?)
Please remember that AFAIK, what I'm asking about is impossible, but I
-
From: Jamie Jackson [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 05, 2004 12:43 PM
To: CF-Talk
Subject: Re: REReplace: Manipulating Backreferences
That's not quite what I've got going on. Notice that while you used
backreferences, you didn't *process* them at all. (Maybe that's how I
the backreference matches except stick it in the
replace string somewhere.
Cheers,
barneyb
-Original Message-
From: Jamie Jackson [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 05, 2004 12:43 PM
To: CF-Talk
Subject: Re: REReplace: Manipulating Backreferences
That's not quite what I've
You need to 'remember' the character grabbed by the dot in a backreference:
rereplace(string, (.)/(.), \1 / \2, all);
That should take care of you.If you have any more questions, we might
want to move to CF-Regex (available via the HoF archives if you don't
want to subscribe).
--Ben Doom
You need to grab the S from DOGS and the C from Cats that you are replacing.
For example:
cfset Variables.myNewVar = rereplace(Variables.myOldVar,(.)/(.), .\1/\2.,All)
the () around the dots grabs those values.
The \1 and \2 put them back in.
Does that make sense?
Jerry Johnson
[EMAIL
If you search the cf-regex archives, they're full of stuff like this. It's
a common problem.
What you are seeing (I suspect) is the regex grabbing everything from the
div id=whatever to the last /div. This is because regex, by default,
uses greedy matching.
In CFMX, you can do a non-greedy
reReplace = replaces based on a RE (Regular Expression)
and
Replace = replaces based on a string literal? or string?
...tony
Tony Weeg
Senior Web Developer
UnCertified Advanced ColdFusion Developer
Information System Design
Navtrak, Inc.
Mobile workforce monitoring, mapping reporting
Tuan writes:
Can somebody explain what the difference is between the REReplace and Replace
function? Im confused when to use one or the other and their differences.
replace() is a simple function to replace one character (or string of
characters) with another.
for example, in the string
From: Tuan [mailto:[EMAIL PROTECTED]]
Can somebody explain what the difference is between the
REReplace and Replace function? Im confused when to use one
or the other and their differences.
Here's an example.
cfset myString=a1b2c3d4e5f6g7h8i9j0
If I wanted to remove the number 1 from
Replace() looks for a literal string within another string and replaces it
with yet a third string:
Replace(contentstring, stringtoreplace, replacement);
With REReplace(), you can search for and replace with regular expressions.
This makes the function much more powerful and often more useful,
: Regular Expressions can be quite powerful, and I've only scratched the
: surface. The syntax can be hard to grok, though. (I don't pretend to be
: anything but a Regular Expression amateur.)
If you knew the number of times that this particular RENinja learned a new
trick from an ameteur who did
- Original Message -
From: Ben Doom [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Friday, February 14, 2003 2:51 PM
Subject: RE: REReplace and Replace function
Replace() looks for a literal string within another string and replaces it
with yet a third string:
Replace(contentstring
Russ wrote:
Everything works nicely from a display perspective. In order to be
safe, secure and prevent anyone from entering junk into our
comments--such as unclosed HTML tags or other junk that could break
the site, I have set the following:
CFSET commentOutput =
Switch the order. First strip ALL HTML (it is theirs), then
add your own.
Gah!
Thanks; I don't know why it didn't occur to me to do it that way. Extra
set of eyes, indeed!
Peace.
~|
Archives:
I don't know if it'll help in your situation, but I've done a BBML
parser in CF that might solve some of your problems:
http://www.depressedpress.com/DepressedPress/Content/ColdFusion/CustomTa
gs/DP_ParseBBML/Index.cfm
The basic idea is that users are allowed a simplified version of HTML,
BBML
htmlEditFormat htmlEditFormat. htmlEditFormat...
Am I the only person in the whole world that uses this function?
- Original Message -
From: Russ [EMAIL PROTECTED]
Date: Wednesday, February 5, 2003 5:57 pm
Subject: RE: ReReplace for HTML tags
Switch the order. First strip ALL
HEHE :)
Pablo
- Original Message -
From: [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Wednesday, February 05, 2003 7:01 PM
Subject: Re: RE: ReReplace for HTML tags
htmlEditFormat htmlEditFormat. htmlEditFormat...
Am I the only person in the whole world that uses
-Talk
Subject: RE: ReReplace for HTML tags
I don't know if it'll help in your situation, but I've done a BBML
parser in CF that might solve some of your problems:
http://www.depressedpress.com/DepressedPress/Content/ColdFusio
n/CustomTa
gs/DP_ParseBBML/Index.cfm
The basic idea
-Original Message-
From: Russ [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 05, 2003 8:08 PM
To: CF-Talk
Subject: RE: ReReplace for HTML tags
Sounds a lot like what I was contemplating tackling next,
either that or reinventing something else I've done before in
.asp
Double check your spelling.
Rick
-Original Message-
From: FlashGuy [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 16, 2002 11:29 AM
To: CF-Talk
Subject: REReplace
For some reason I can't to a replace on the following:
dir = D:\\
cfset test = #RERplace(dir,\\,\,ALL)#
It might be the \ escaping itself.
Try Replace() instead.
Ade
-Original Message-
From: FlashGuy [mailto:[EMAIL PROTECTED]]
Sent: 16 December 2002 17:29
To: CF-Talk
Subject: REReplace
For some reason I can't to a replace on the following:
dir = D:\\
cfset test =
I am sure there is a better way, however the \ is part
of the ReReplace command for RegularExpressions.
Try:
cfset dir=D:\\
cfset slash_counter = #FindNoCase(\\,dir,1)#
CFLOOP condition=slash_counter NEQ 0
cfset dir=#Replace(dir,\\,\,All)#
cfset slash_counter =
Nevermind...
On Mon, 16 Dec 2002 12:29:23 -0500, FlashGuy wrote:
For some reason I can't to a replace on the following:
dir = D:\\
cfset test = #RERplace(dir,\\,\,ALL)#
---
Colonel Nathan R. Jessop
Commanding Officer
Marine
cfset test = #REReplace(dir,\\,\,ALL)#
-Original Message-
From: FlashGuy [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 16, 2002 12:29 PM
To: CF-Talk
Subject: REReplace
For some reason I can't to a replace on the following:
dir = D:\\
cfset test = #RERplace(dir,\\,\,ALL)#
\ is a special character, so you have to escape it
cfset test = #REReplace(dir,,\\,ALL)#
But in this case you're better off just using replace:
cfset test = #Replace(dir,\\,\,ALL)#
At 12:29 PM 12/16/2002, you wrote:
For some reason I can't to a replace on the following:
dir = D:\\
cfset
: Monday, April 22, 2002 6:11 PM
To: CF-Talk
Subject: RE: REReplace and RegExp
Actually, this looks like a UDF candidate for cflib.org. Ray Camden?
I don't have time to format it nicely for cflib.org. Anyone wants to
volunteer? :)
// Assuming that strFind and strReplace has no RegExp
: Monday, April 22, 2002 5:45 PM
To: CF-Talk
Subject: RE: REReplace and RegExp
Try this:
REReplaceNoCase(agents, (/?)agent([[:space:]]*|[[:space:]]+[^]*),
\1a\2, ALL)
I have tested this code on CFAS 5 on WinXP.
James Ang
Senior Programmer
MedSeek, Inc.
-Original Message-
From: Troy
-Talk [EMAIL PROTECTED]
Sent: Tuesday, April 23, 2002 8:04 AM
Subject: RE: REReplace and RegExp
James,
Thanks for the response. It has given me other ideas about how to
approach this.
It appears that the solution you provided only replaces that Tags, which
is part of the desired solution. I also
PM
To: CF-Talk
Subject: Re: REReplace and RegExp
Troy,
What you need is a 2-part parser. There isn't an easy way unless you
decide to use MS XML Parser or the Apache.org Java parser to parse the
XML.
If you decided not to use the Apache or the MS XML parsers, here's how
your tag parser would do
a portion of the
Apache parser.
Good luck! :)
James Ang
Senior Programmer
MedSeek, Inc.
[EMAIL PROTECTED]
-Original Message-
From: Troy Simpson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 11:07 AM
To: CF-Talk
Subject: RE: REReplace and RegExp
Try this:
REReplaceNoCase(agents, (/?)agent([[:space:]]*|[[:space:]]+[^]*),
\1a\2, ALL)
I have tested this code on CFAS 5 on WinXP.
James Ang
Senior Programmer
MedSeek, Inc.
-Original Message-
From: Troy Simpson [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 22, 2002 2:15 PM
To:
retVal;
}
James Ang
Senior Programmer
MedSeek, Inc.
[EMAIL PROTECTED]
-Original Message-
From: James Ang
Sent: Monday, April 22, 2002 2:45 PM
To: CF-Talk
Subject: RE: REReplace and RegExp
Try this:
REReplaceNoCase(agents, (/?)agent([[:space:]]*|[[:space:]]+[^]*),
\1a\2, ALL)
I have tested
Perhaps your hitting this:
From the CFDOCS:
In CFML regular expression functions, large input strings (greater than
approximately 20,000 characters) cause a debug assertion failure and a
regular expression error occurs. To avoid this, break your input into
smaller chunks, as the following
i believe regex in cf limitted to about 20k
- Original Message -
From: James Sleeman [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Thursday, January 31, 2002 10:30 PM
Subject: ReReplace(NoCase) maximum length
Hi All,
anybody know if there is a maximum length on the string
This will remove, or replace with blanks, all non-alphanumeric characters.
CFSET str_MyVar = REReplace(str_MyVar, "[^a-zA-Z0-9]", "", "ALL")
Regards,
Steve
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 16, 2000 8:38 PM
To: CF-Talk
Subject:
I think you need to use something along the lines of chr(13) chr(10)
RPS
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
But, in the Excel file that is appended, I do not need the
html, therefore it needs to be taken out. I would assume I use ReRlace,
but
I am unsure of the reg_expression that I would use. Anyone have any ideas?
cfset text = REReplace(text, "[^]*", "", "All")
where 'text' is your stuff.
HTH,
94 matches
Mail list logo