I'd be careful there,

For any whitespace character, sometimes it's [[:space:]] and sometimes it's
[:space:].

As far I can make out by trial-and-error, you normally use the
double-brackets, but when you are using [] to group characters, you only use
single-brackets around in the POSIX char:
[^[:space:]_]

As i say, I have just come to this conclusion myself, haven't seen it
documented anywhere.  I have found that using the double-brackets inside
grouping brackets doesn't give the results I have intended (no nice error
messages though).

Best of luck,
Lee (Bjork) Borkman
http://bjork.net ColdFusion Tags by Bjork



-----Original Message-----
From: Jeremy Allen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 12, 2000 3:25 AM
To: [EMAIL PROTECTED]
Subject: RE: REGEX for a space


Allaire uses something terrible like [[:space:]] and [[:print:]]

instead of \s

for its backslash type stuff.  It makes some Regex, huge but it is
functional.


Jeremy

-----Original Message-----
From: Steve Bernard [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 11, 2000 1:21 PM
To: [EMAIL PROTECTED]
Subject: RE: REGEX for a space


What you are experiencing is Allaire's poor choice of third-party RegEx
engines. I'd call Customer Service and say something. I've been doing it for
awhile without much luck but, some backup couldn't hurt.

Steve


-----Original Message-----
From: Andrea Wasik(CancerSource) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 07, 2000 3:46 PM
To: [EMAIL PROTECTED]
Subject: REGEX for a space


I am looping over a list that contains the names of mailing lists. The
delimiter in the loop is the carriage return. I am trying to identify the
position of the first space in the index. I thought the regex for a space
was /s, but that is not working here as the REFind always returns a zero.
This is what one line of the list looks like:

        BREASTCANCER 1999-12-30 0 0 0 0 0 0 0 0

and here is my code:

<cfloop list="#logfile#" delimiters="#Chr(13)##Chr(10)#" index="line">
        <cfset linelength = Len(line)>
        <cfset CurrentlistwordSTART = REFind('([A-Za-z]+)', line, "TRUE")>
        <cfset SpacePositionAfterFirstWord = REFind('\s+', line)>
        SpacePositionAfterFirstWord:
<cfoutput>#SpacePositionAfterFirstWord#</cfoutput><br>
        <cfset daypositionstart = SpacePositionAfterFirstWord + 1>
        <cfset daypositionend  = daypositionstart + 10>
        <cfset CurrentListList = Left(line, linelength)>
        <cfset CurrentList = Left(line, SpacePositionAfterFirstWord -1)>
        <cfset currentday = Mid(line, daypositionstart, daypositionend)>
        CurrentDay: <cfoutput>#currentday#</cfoutput><br>
</cfloop>

I don't really need the currentlistwordStart variable since the word is
always the first thing on each new line. My problem is the 2nd REFind:
REFind('\s+', line), which always gives me a zero.

The files I am parsing are the ListServ log files, in case anyone is
curious. They don't have any type of log analysis available so I am trying
to create my own.

Thanks

----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to