Ask a Question related to Coldfusion - Getting Started, Design and Development.
-
Conti #1
A quick brown regex, please ...
Need to strip "-", "/" and any number of commas after the las character of the string.
This /[\,\/-]/g, "" almost does it, but it strips "all" of the commas. Thanks in advance.
ContiW
Conti Guest
-
XML Quick help
I am working on a simple flash interface, ussing the tutorial below. http://www.macromediahelp.com/flash/simple_flash_and_xml_sample/ It is all... -
Looking for Colors Brown and Blue
I am trying to find the color Brown and Blue. Illustrator gives me orange and red, but not brown or blue. -
Brown popups offering to give programs to block popups
are these genuine ads to protect windows xp owners or are they spyware ads. as they all sem to want to stop popups, but the most popups i get... -
Quick Q about $|
Hi, What does: $|=1; select(STDOUT); do? I understand that STDOUT is selected as the default handle, but what about the bit preceding it?... -
BKBK #2
Re: A quick brown regex, please ...
Hmm, sounds like a cracker. I don't know much about RegEx, but one of my guiding
instincts is, whenever the problem contains the word "and" , I look for a
stepwise answer.
For example, here, I would first strip out "/" and "-". Then, in the next
step, I would strip out
the commas at the end.
<cfset s="Need - to strip -, / and any num/ber of commas, after the, last
char-acter, of the string.,,,,,">
<strong>original string:</strong> <cfoutput>#s#</cfoutput><br>
<!--- Step 1 --->
<cfset t = REReplace(s,"[\/-]","","all")>
<strong>"/" and "-" removed:</strong> <cfoutput>#t#</cfoutput><br>
<!--- Step 2 --->
<strong>Trailing commas removed:</strong>
<cfoutput>#REReplace(t,",+$","","all")#</cfoutput>
BKBK Guest
-
Conti #3
Re: A quick brown regex, please ...
Thanks very much BKBK. I didn't mention that it was for a JavaScript function.
My fault. And I cannot think about performing the commas replacement with
ColdFusion as the followinf step is using the string in
"FCKConfig.ToolbarSets[userToolbar].innerHTML = regexedString". Thanks anyhow.
Appreciate.
WalterConti
Conti Guest
-
Conti #4
Re: A quick brown regex, please ...
Thanks very much BKBK. I didn't mention that it was for a JavaScript function.
My fault. And I cannot think about performing the commas replacement with
ColdFusion as the followinf step is using the string in
"FCKConfig.ToolbarSets[userToolbar].innerHTML = regexedString". Thanks anyhow.
Appreciate.
WalterConti
Conti Guest
-
BKBK #5
Re: A quick brown regex, please ...
<script language="JavaScript">
s="Need - to strip -, / and any num/ber of commas, after the, last char-acter,
of the string.,,,,,";
alert(s);
re1=/[\/-]/g;
re2=/,+$/;
t1 = s.replace(re1,"");
alert("/ and - removed: "+t1);
t2 = t1.replace(re2,"");
alert("trailing commas removed: "+t2);
</script>
BKBK Guest
-
Conti #6
Re: A quick brown regex, please ...
Wow, I swear I didn't do the multiple send!
Thank you BKBK. Cheers for the feedback!
WalterConti
Conti Guest



Reply With Quote

