I am trying to convert strings:
(A XXX)(B YYY)(C ZZZ) etc.
to
XXXYYYZZZ etc.
This works in sed:
echo (A XXX)(B YYY)(C ZZZ) | \
sed -n '
{
s/([A-Z]* \([A-Z]*\))/\1/g
p
}
'
but when I put it into rereplace, like:
cfset construct[LoopCount] = rereplace(#construct[LoopCount]#,
[A-Z
cfset str = (A XXX)(B YYY)(C ZZZ) /
cfset newstr = rereplace(str, \([A-Z] ([A-Z]{3})\), \1, all) /
.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
http://cf4em.com
-Original Message-
From: Rick Colman [mailto:rcol...@cox.net]
Sent: Thursday, May 05, 2011 5:43 PM
Eureka! TNX.
On 5/5/2011 3:13 PM, Bobby Hartsfield wrote:
cfset str = (A XXX)(B YYY)(C ZZZ) /
cfset newstr = rereplace(str, \([A-Z] ([A-Z]{3})\), \1, all) /
.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
http://cf4em.com
-Original Message-
From: Rick
cfsavecontent variable=pageTitletitleYour title cfoutput -
#Yourvaraible#/cfoutput/title/cfsavecontent
cfhtmlhead text=#pageTitle#
This will put #pageTitle# in the head of the document.
On Thu, Nov 18, 2010 at 4:05 PM, Joel Black j...@blackbeardesign.comwrote:
Gerald, cfhtmlhead text= was the key. I didnt even have to savecontent or
anything else. I simply added this to my custom tag and it does just what its
supposed to!
Never even knew this tag existed, thanks a million!
~|
Slightly OT, but I suspect this indicates that your app would benefit from a
separation of display logic and business logic.
On Fri, Nov 19, 2010 at 10:24 AM, Joel Black j...@blackbeardesign.comwrote:
Gerald, cfhtmlhead text= was the key. I didnt even have to savecontent
or anything else.
I simply added this to my custom tag and it does just what its supposed
to!
Yep. Reason 32,657 why CF Roxorz.
G!
On Fri, Nov 19, 2010 at 10:24 AM, Joel Black j...@blackbeardesign.comwrote:
Gerald, cfhtmlhead text= was the key. I didnt even have to savecontent
or anything else. I simply
...until you need to hire five new developers in any place that isn't
California.
:(
On Fri, Nov 19, 2010 at 11:04 AM, Gerald Guido gerald.gu...@gmail.comwrote:
I simply added this to my custom tag and it does just what its supposed
to!
Yep. Reason 32,657 why CF Roxorz.
G!
On Fri,
an output
before a query that I know of
3. Not sure if an ReReplace will work in this situation either
4. I know I can do it with javascript, but javascript is client side and will
not change the title in time for a search engine to catch it will it?
Any input would be greatly appreciated. Example
2. I want the news title to be in the page title, but I cant put an output
before a query that I know of
No, but you can run the query before any HTML, ie :
CFQUERY NAME=myQuery
--- get the tithe in son=me column ---
SELECT title, ...
/CFQUERY
html
head
: Joel Black [mailto:j...@blackbeardesign.com]
Sent: November-18-10 12:27 PM
To: cf-talk
Subject: Variable before query, rereplace or javascript to change title
I created a custom tag I can reuse, which runs a news manager. I would like
to optimize it for search engines, but here is my issue:
1
Wrap the custom tag in a cfsavecontent tag at the top of the page:
I gave this a try, but when I wrap it in the savecontent, its not reading the
query when I put it in the title
~|
Order the Adobe Coldfusion Anthology now!
Wrap the custom tag in a cfsavecontent tag at the top of the page:
I tried to do this, but the query.title doesnt read the query within the save
content. I also tried to set a variable within the custom tag and pull that
out...but no success there either. What if i set an application
cfsavecontent variable=pageTitletitleYour title cfoutput -
#Yourvaraible#/cfoutput/title/cfsavecontent
cfhtmlhead text=#pageTitle#
This will put #pageTitle# in the head of the document.
On Thu, Nov 18, 2010 at 4:05 PM, Joel Black j...@blackbeardesign.comwrote:
Wrap the custom tag in a
To: cf-talk
Subject: Re: Variable before query, rereplace or javascript to change title
Wrap the custom tag in a cfsavecontent tag at the top of the page:
I tried to do this, but the query.title doesnt read the query within the
save content. I also tried to set a variable within the custom tag
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 appreciate any input:
for example i would the the string: 'Genns,,DrBish Stratford,,,'
to become: 'Genns,Dr,Bish
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
I am just going over some old code, I found the following...
productPageName = Replace(#FORM.pageName#, ,-,All);
productPageName = REReplace(#productPageName#,[.*+?^${}()|[\]/\\],,All);
its seems like its create a page name but removed spaces and special characters
i.e. this page! becomes
these two lines of code into a UDF.
On Wed, Oct 21, 2009 at 11:07 AM, Glyn Jackson
glyn.jack...@newebia.co.uk wrote:
I am just going over some old code, I found the following...
productPageName = Replace(#FORM.pageName#, ,-,All);
productPageName = REReplace(#productPageName#,[.*+?^${}()|[\]/\\],,All
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
FileName = rereplace( FileName , '(?!\.[^.]*$)\W' , '' , 'all' )
Strips all non-word characters, excluding the final dot (if any).
Although, thinking a bit more... for general purpose use, I might not bother
stripping dots, or hyphens, or tilde, so might end up with this instead:
FileName
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
Regular Expression gurus. How to use the REreplace function to remove special
characters including +, . in an image file name? The ReplaceList function
may miss some unexpected special characters for we don't know what sort of
special character may show up in a dynamically generated image
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
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. All has been working
fine and well until recently when one of those key words became sub and
some paragraphs make use of the HTML element SUB. So what I am curious
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
worked had my test data not had the word at the very end of the paragraph
with no period after it.
On Thu, Nov 6, 2008 at 1:13 PM, Peter Boughton [EMAIL PROTECTED] wrote:
I have been using REReplace to find key words or group of words within
paragraphs and if found to replace those with an HREF
MX7 Developer
www.bennadel.com
Need ColdFusion Help?
www.bennadel.com/ask-ben/
-Original Message-
From: Jon Clausen [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 15, 2007 8:17 PM
To: CF-Talk
Subject: Re: Using reReplace Backreference as StructKey or Argument
Ben,
Thanks
Ben,
Agreed, the Len/Pos array loops are ugly and a pain to deal with.
Hence my attempts to bypass all of that by finding a way to pass the
backreference directly in reReplace... :-)
Got around to running timers comparing reFind and your reMatchGroups
function against each other
reReplace Backreference as StructKey or Argument
Ben,
Agreed, the Len/Pos array loops are ugly and a pain to deal with.
Hence my attempts to bypass all of that by finding a way to pass the
backreference directly in reReplace... :-)
Got around to running timers comparing reFind and your
Jon,
You cannot do that because the arguments of the REReplace() method are
eveluated at the initial method execution time. Back references within a
string are fine because they are evaluated within the inner working of
the RERepalce() method. However, you cannot use them as part of another
far.
For now I've written the code out using a loop with reFind(),
returning subexpressions, mid(), etc. but it seems to me there should
be a way to do this using reReplace() and pass the backreference as an
argument/key. Usage of evaluate() would probably be a deal-breaker
since
that because the arguments of the REReplace() method are
eveluated at the initial method execution time. Back references
within a
string are fine because they are evaluated within the inner working of
the RERepalce() method. However, you cannot use them as part of
another
structure (ie, struct
(), etc. but it seems to me there should
be a way to do this using reReplace() and pass the backreference as
an
argument/key. Usage of evaluate() would probably be a deal-breaker
since it would be less expensive to perform the loop.
Here's examples of what i'm trying to do:
!--- Trying
(),
returning subexpressions, mid(), etc. but it seems to me there should
be a way to do this using reReplace() and pass the backreference as an
argument/key. Usage of evaluate() would probably be a deal-breaker
since it would be less expensive to perform the loop.
Here's examples of what i'm trying
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\' REReplace(ARGUMENTS.File, '.jpg',
'.gif', 'ALL') /
ARGUMENTS.File is a string that looks like 'myfile.jpg'
Am I missing something here?
Thanks
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
(literally, journal, book
etc.) in some cases it can contain a slash (/) or a semicolon.
What I need to do within the REReplace is find every instance of a slash or
a semicolon and put a space before it and a space after it..
Thanks
sas
Scott Stewart
ColdFusion
IÂve got a variable which is a document descriptor (literally, journal, book
etc.) in some cases it can contain a slash (/) or a semicolon.
What I need to do within the REReplace is find every instance of a slash or
a semicolon and put a space before it and a space after it..
Thanks
sas
This should work:
reReplace(myVar,([;/]), \1 ,all)
It uses a technique called back references, which allows you to use
the strings that match the regex in your replacement string (that's
what the \1 is).
On 3/28/07, Scott Stewart [EMAIL PROTECTED] wrote:
I've got a variable which is a document
I cannot findout why this works:
cfset Form.City1 = rereplace(Form.City1,),( , all)
and this does not:
cfset Form.City1 = rereplace(Form.City1,(,( , all)
the problem is when the string to be replaced is ( or chr(40). The character
replacing it can be ( or ( it does not matter, it would work
Probably because ( is a reserved character for GROUPS in regular
expression. Try escaping:
cfset Form.City1 = rereplace(
Form.City1,
\(,
( ,
all
)
Notice the \ before the (
..
Ben Nadel
Certified Advanced ColdFusion MX7 Developer
Because regular expression parsers see '(' as the beginning of a regex
group whereas ')' is evaluated literally. You'll need to escape the
opening parenthesis.
cfset Form.City1 = rereplace(Form.City1,\(,( , all)
Steve Brownlee
http://www.fusioncube.net/
-Original Message-
From
erm, not using a regex, so no need for rereplace?
cfset Form.City1 = Replace(Form.City1,(,( , all)
On 20/12/06, Ben Nadel [EMAIL PROTECTED] wrote:
Probably because ( is a reserved character for GROUPS in regular
expression. Try escaping:
cfset Form.City1 = rereplace(
Form.City1
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 (#request.mySTRING#,[[:space:]],+,ALL)
That works fine.
But ... and there's always a but - I need to replace all commas too.
They just need
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 (#request.mySTRING#,[[:space
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
On Tuesday 31 October 2006 16:41, Claude Schneegans wrote:
Just write proper JavaScript, avoiding the nasty IE hacks and
known specifics and it'll run in IE and FF without issue.
If you just stick to what's standard, you will not go very far.
Well, yes, innerHTML :-)
But things like that
On Monday 30 October 2006 15:19, Claude Schneegans wrote:
http://www.contentbox.com/claude/REwizard/index.cfm?p=h
This product can be used only with Internet Explorer 5.5+ under Windows.
Pfft.
delete
--
Tom Chiverton
Helping to preemptively disseminate killer technologies
Just write proper JavaScript, avoiding the nasty IE hacks and
known specifics and it'll run in IE and FF without issue.
If you just stick to what's standard, you will not go very far.
I do not use much Javascript in the public parts of my sites,
si I can easily keep it compatible.
But in the
On 10/31/06, Claude Schneegans [EMAIL PROTECTED] wrote:
This product can be used only with Internet Explorer 5.5+ under Windows.
Sorry about that. When I started this project, FireFox didn't even exist.
Although the Javascipt code used in the REwizard is fairly complex,
I'll be glad to
This product can be used only with Internet Explorer 5.5+ under Windows.
Sorry about that. When I started this project, FireFox didn't even exist.
Although the Javascipt code used in the REwizard is fairly complex,
I'll be glad to update it for FF,... when they publish a decent docs
about all
On Tuesday 31 October 2006 15:47, Claude Schneegans wrote:
I'll be glad to update it for FF,... when they publish a decent docs
about all features,
Why bother* ? Just write proper JavaScript, avoiding the nasty IE hacks and
known specifics and it'll run in IE and FF without issue.
If a
I need to take any email address and transform it with a regular expression
in a REReplace so that everything after the @ and before the FINAL period
is replaced by the same number of asterisks as there are characters being
replaced. So for example:
[EMAIL PROTECTED] = [EMAIL PROTECTED
, Karl [EMAIL PROTECTED] wrote:
I need to take any email address and transform it with a regular expression
in a REReplace so that everything after the @ and before the FINAL period
is replaced by the same number of asterisks as there are characters being
replaced. So for example:
[EMAIL
and transform it
with a regular expression
in a REReplace so that everything after the @ and
before the FINAL period
is replaced by the same number of asterisks as there
are characters being
replaced. So for example:
[EMAIL PROTECTED] = [EMAIL PROTECTED]
[EMAIL PROTECTED] = [EMAIL
I work with a gentleman here, Adam Presley, who
wrote a pretty good app for constructing and testing
regular expressions.
I consider myself also as a gentleman, and I have such an application in
CF online here :
http://www.contentbox.com/claude/REwizard/index.cfm?p=h
--
, 2006 10:19 AM
To: CF-Talk
Subject: Re: Need regular expression in REReplace for email
I work with a gentleman here, Adam Presley, who
wrote a pretty good app for constructing and testing
regular expressions.
I consider myself also as a gentleman, and I have such an application in
CF online here
maskedemail;
}
/cfscript
cfoutput#maskemail('[EMAIL PROTECTED]')#/cfoutput
and this one actually uses the variables I set hehe
-Original Message-
From: RichL [mailto:[EMAIL PROTECTED]
Sent: Monday, October 30, 2006 8:39 AM
To: CF-Talk
Subject: Re: Need regular expression in REReplace
Message-
From: Mike | NZSolutions Ltd [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 30, 2005 10:59 PM
To: CF-Talk
Subject: REReplace
Hi there,
I wish to remove the img tags from an article for email purposes.
I have...
cfset mail_content = REReplaceNoCase(arguments.body, (img
Hi there,
I wish to remove the img tags from an article for email purposes.
I have...
cfset mail_content = REReplaceNoCase(arguments.body, (img [^]+),
Image removed - please log into website to view, all)
However, this doesn't seem to be working ??
mike
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
I've been handed a mySQL database with weird stuff in some text fields:
Õ instead of ' - for example
or things like ÒSet For LifeÓ for left and right quotes
I'd like to run a query and remove all these using rereplace, but a test
query like the below is returning an error
cfloop query=myQUERY
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
example code for doing it better?
-Original Message-
From: Barney Boisvert [mailto:[EMAIL PROTECTED]
Sent: 25 August 2005 18:15
To: CF-Talk
Subject: Re: Replace or REReplace function question.
First, I'd recommend not using CF markup for the fields. Or at least
don't require the CFOUTPUT
Hi all, I am trying to come up with a way to do the following;
User creates/edits a basic letter/mailshot document on line using FCKeditor.
Within this document the user can add some pre-defined CF output fields i.e.
cfoutput#details.firstname#/cfoutput.
This is with the idea of trying to do a
]
Sent: 25 August 2005 14:37
To: CF-Talk
Subject: Replace or REReplace function question.
Hi all, I am trying to come up with a way to do the following;
User creates/edits a basic letter/mailshot document on line using FCKeditor.
Within this document the user can add some pre-defined CF output
First, I'd recommend not using CF markup for the fields. Or at least
don't require the CFOUTPUT tags, just the hashes. If you have a small
number of fields, loop over them and just do a replace(string,
##detail.firstname##, detail.firstname, all) for each one. Not
real elegant, but it is
Does anyone have any suggestions/ideas on the best way to replace my
tags with the required text?
Have a look at CF_REextract here:
http://www.contentbox.com/claude/customtags/REextract/testREextract.cfm?p=hf
It will allow you to get in a query all occurrences of
CFOUTPUT/CFOUTPUT
tags and
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/
If you want to delete cr/lf:
REReplace(str,\r?\n,,all)
This is CFMX only (this should take care of cr/lf on windows AND lf on
*nix). I never used a Mac, but if I understood correctly, \n will take
care of cr on a Mac.
For CF5, use #chr(13)#?#chr(10)# (this won't take care of mac,
although I
hi there.
i need to remove all carriage returns and white space from the
contents of a cfsavecontent. one problem.
however, there are some *good* #Chr(13)##Chr(10)# that i want to keep.
so, what i was thinking, is to put something like #Chr(0)# at each *good* spot
then after i replace all
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
1 - 100 of 205 matches
Mail list logo