Thank you for your prompt response, however, what you suggest doesn't 
work.  The problem with what you suggest is, according to the CF manual, 
the caret in front of a string means "the matched string must be at the 
beginning of the string being searched".  In order to exclude the string, 
it must be in brackets, ([]), but then it tries to exclude the 
parentheses.  The more I play with different strings, the more I'm 
convinced that you cannot exclude as specific string - only characters.  I 
don't know if this is a short-coming of CF or of regular expressions in 
general.

Thanks for try'n.

Oblio

At 5/1/00 09:41 AM, you wrote:
>Try this (untested, but should be darn close):
>REFind("<!-- snip -->^(<!-- /snip -->)<!-- /snip -->", file)
>
>In the first one you tried, must realize that regexp are by default
>"hungry".  They will match on the largest match possible.  In your case this
>meant that the regexp was matching the first opening tag all the way to the
>last closing tage due to the ".*".
>
>In your second one you were much closer but "[^<!-- /snip -->]" means to
>match any of the following: not "<" or ! or - or / or s or n, etc.
>
>Try it with parens as above to say "not this pattern".
>
>Jonathan McGuire
>
>----- Original Message -----
>From: "Oblio Leitch" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Sunday, April 30, 2000 4:02 PM
>Subject: Regular Expressions
>
>
>I'm having trouble and I was hoping someone can help me.
>
>Senario: I have a page that I'm trying to extract pieces from. To mark the
>section I'm trying to edit, I've place <!-- snip --> and <!-- /snip -->
>around the section. Next, I'm opening the file (CFFILE) and doing a regular
>expression to find that section: REFindNoCase("<!-- snip
>-->.*<!-- /snip -->", file). Works great. Now, to make several places on
>the page editable, I placed several snips. Now the regular expression
>only finds the first open snip and the last close snip, including all the
>others inside.
>
>Question: How do I find just those sections? I thought about doing
>REFindNoCase("<!-- snip -->[^<!-- /snip -->]*", file), but that doesn't
>work - it excludes all the characters instead of the whole string. Is there
>a way to exclude a complete string instead of just a group of
>characters?
>
>Any suggestions would be most helpful. Any example would be great too.
>
>----------------------------------------------------------------------------
>--
>Archives: http://www.eGroups.com/list/cf-talk
>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.eGroups.com/list/cf-talk
>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.eGroups.com/list/cf-talk
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