God bless you, Ronald; thank you!

I had been studying negative lookahead assertions, but could not 
get it to work; I was not putting the initial search “(.+)” 
_inside_ the negative lookahead assertion. I had tried:

^(.+)(?!Excluding)(.+)(\r+)

but that would select every line, regardless of the existence of 
“Excluding”. Moving the initial text _inside_ the negative 
lookahead assertion, as per your suggestion:

^(?!.+Excluding)(.+)(\r+)

did the trick! Thank you; I’ve been working on this for hours!!

X-)

Blessings!

Richard


======  Original Message  ======
From: Ronald J Kimball  [[email protected]]
Sent: Friday, February 20, 2009 at 12:22 PM

On Fri, Feb 20, 2009 at 10:46:00AM -0700, Richard Fairbanks wrote:
>
>Ditto. What I need to know is how to find any line that does 
>not contain the word "Excluding"; the following do not work:
>
>^(.+)(?:Excluding)(.+)(\r+)

This will match lines that /do/ contain the word 'Excluding', 
other than as
the very first or very last thing in the line.

>^(.+)(^(Excluding))(.+)(\r+)

This won't match anything.  You can't match the beginning of 
line at two
different places in the same line.


Try this:

^(?!.*Excluding)(.+)(\r+)

Starting from the beginning of a line, do a negative lookahead for
.*Excluding.  If the word 'Excluding' appears anywhere in the 
line, this
will find it.  If it's not found, then match the whole line and 
any number
of carriage returns.

Ronald


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "[email protected]" 
rather than posting to the group.
-~----------~----~----~----~------~----~------~--~---

Reply via email to