Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
_andyK #1
Regular Expression - Need Help
Hi,
I have the following:
<cfset input ="
Origin: cohnok-530a
(190.068.59.250)
Type: Log
Action: Accept
Service: nagios-nsc
lient (1248)">
For the line that starts with Service. I want it to be one continous line
Service: nagios-nsclient (1248)
I've tried the code below, but it is not doing the trick.
<cfset input = REreplace (input, "[[:cntrl:]]"," ","ALL")>
Any Advice on how to make this work would be greatly appreciated.
Thanks
Andy
_andyK Guest
-
Regular Expression
Hi, I am writing a script that parses an html file (which has been retrieved as a scalar by LWP::UserAgent). The script looks for everything in... -
Regular expression help
Hi, I'm pretty new to regular expressions. Before, I used to write long-winded and buggy segments of code with PHPs string functions to extract... -
Regular expression for both first and last name?
I'm new to regular expressions, can someone explain to me how I can write one that will check for 2 names, at least, for a name field? Thanks!... -
help on regular expression
Hi, I need some help on regular expression... i have following in variable $total_count $total_count = "##I USBP 000001 10:38:09(000)... -
[PHP] REGULAR EXPRESSION HELP
John wrote: Your "newline" may be \r\n or \r instead of just \n. -- ---John Holmes... Amazon Wishlist:... -
CF_fdk #2
Re: Regular Expression - Need Help
try to use back referencing in the regular expression.
CF_fdk Guest
-
_andyK #3
Re: Regular Expression - Need Help
Can't seem to figure out how to get that to work
_andyK Guest
-
Adam Cameron #4
Re: Regular Expression - Need Help
On Thu, 19 May 2005 16:46:16 +0000 (UTC), _andyK wrote:
What exactly do you mean? From your example, the line wrap comes from your> Hi,
>
> I have the following:
> <cfset input ="
> Origin: cohnok-530a
> (190.068.59.250)
> Type: Log
> Action: Accept
> Service: nagios-nsc
> lient (1248)">
>
> For the line that starts with Service. I want it to be one continous line
> Service: nagios-nsclient (1248)
own code. If you don't want it there... take it out.
I'm guessing it's not entirely clear as to the circumstances that line gets
broken (because it's certainly not what you're suggesting).
Elaboration?
--
Adam
Adam Cameron Guest
-
_andyK #5
Re: Regular Expression - Need Help
Adam,
The line is broken. I am importing this text from a file and in some instances this sort of line wrap happens. So I need a way to make it one long line.
Thanks
Andy
_andyK Guest
-
Adam Cameron #6
Re: Regular Expression - Need Help
[url]http://livedocs.macromedia.com/coldfusion/7/htmldocs/00000987.htm[/url]
You probably wannna look at \s
--
Adam
Adam Cameron Guest
-
_andyK #7
Re: Regular Expression - Need Help
Adam,
Thanks, I tried it but I can not figure out how to get the reg expression
syntax:
<cfset input = REreplaceNoCase (input,
"[a-z][[:cntrl:]]([a-z])[[:cntrl:]]+\1","\1","ALL")>
and
<cfset input = REreplaceNoCase (input, "[a-z]\s([a-z])\s+\1","\1","ALL")>
Neither one of these captures the pattern that I am looking for.
Thanks
Andy
_andyK Guest
-
jdeline #8
Re: Regular Expression - Need Help
You may have carriage returns and line feeds (ascii 13 and ascii10,
respectively) in your string. You can remove them with the code below.
<CFSET foo = REReplace(yourString, "#Chr(13)#|#Chr(10)#", " ", "ALL")>
jdeline Guest
-
_andyK #9
Re: Regular Expression - Need Help
<cfset input = REreplaceNoCase (input, "[a-z][[:cntrl:]]([a-z])","\1","ALL")> is the closest I have gotten to make this work but it still fails
The chr.. didn't accomplish anything
Thanks
Andy
_andyK Guest



Reply With Quote

