Re: Find and Replace help please

2018-05-18 Thread Kerri Hicks
OK, then try this, instead.

###(.|\n)*?&&&

--Kerri

On Fri, May 18, 2018 at 12:17 PM Matthew London  wrote:

> Hi Again,
>
> Turns out there are sometimes multiple lines both within my KEEP text and
> in my DELETE text.
>
> le:
> &&&
> Line or Lines to be KEPT
> ###
> Line or Lines to be DELETED
> &&&
> Line or Lines to be KEPT
> ###
> etc.
>
> Grateful for your help
>
> On Wednesday, May 2, 2018 at 12:51:20 PM UTC-7, Kerri Hicks wrote:
>>
>> Use the Find dialog and turn on the "Grep" switch...
>>
>> 1) I have questions about this one. Are the lines to be kept and the
>> lines to be deleted always alternating? (e.g. there's always one to be
>> kept, always followed by one and only one to be deleted?) If not, I'd
>> probably do this one in two steps (first delete the hash lines and the
>> deletable lines, and then just go through and delete all the ampersands,
>> so, use the same expression as #2, and then do another search and replace
>> for &&&\n). (And I just saw that Sam mentions the same strategy. I started
>> this email an hour ago.)
>>
>> 2) ###\n.*?\n
>>
>>>
>>>
>
>
>
>
> --
> This is the BBEdit Talk public discussion group. If you have a
> feature request or would like to report a problem, please email
> "supp...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: 
> ---
> You received this message because you are subscribed to the Google Groups
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to bbedit+unsubscr...@googlegroups.com.
> To post to this group, send email to bbedit@googlegroups.com.
> Visit this group at https://groups.google.com/group/bbedit.
>

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Find and Replace help please

2018-05-18 Thread Matthew London
Hi Again,

Turns out there are sometimes multiple lines both within my KEEP text and 
in my DELETE text.

le:
&&&
Line or Lines to be KEPT
###
Line or Lines to be DELETED
&&&
Line or Lines to be KEPT
###
etc.

Grateful for your help

On Wednesday, May 2, 2018 at 12:51:20 PM UTC-7, Kerri Hicks wrote:
>
> Use the Find dialog and turn on the "Grep" switch...
>
> 1) I have questions about this one. Are the lines to be kept and the lines 
> to be deleted always alternating? (e.g. there's always one to be kept, 
> always followed by one and only one to be deleted?) If not, I'd probably do 
> this one in two steps (first delete the hash lines and the deletable lines, 
> and then just go through and delete all the ampersands, so, use the same 
> expression as #2, and then do another search and replace for &&&\n). (And I 
> just saw that Sam mentions the same strategy. I started this email an hour 
> ago.)
>
> 2) ###\n.*?\n
>
>>
>>


 

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Another Newbie GREP help request...

2018-05-18 Thread Matthew London
I think I see my problem.
I was using "Process Lines Containing" which appears to extract the entire 
line, not matter what I search for.
I used Search with the Extract function, and it works now! 

Thank you


On Friday, May 18, 2018 at 1:47:33 AM UTC-7, Rick Gordon wrote:
>
> Change the .* in your string to [^.]* 
>
> (And you don't need the square brackets around \. ) 
>
> So: 
> from [A-Z][a-zA-Z][^.]*\. 
>
> …which really means: 
>
>  from followed by a space 
>
>  a single capital letter, not including diacriticals/accents 
>
>  a single letter of any case, not including diacriticals/accents 
>
>  any number (including zero) of non-period characters (which may 
> include other punctuation, spaces, line breaks, etc.) 
>
>  a period 
>
> Does that work, or do you need to be more specific? 
>

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Another Newbie GREP help request...

2018-05-18 Thread Rick Gordon

Change the .* in your string to [^.]*

(And you don't need the square brackets around \. )

So:
from [A-Z][a-zA-Z][^.]*\.

…which really means:

from followed by a space

a single capital letter, not including diacriticals/accents

a single letter of any case, not including diacriticals/accents

any number (including zero) of non-period characters (which may 
include other punctuation, spaces, line breaks, etc.)


a period

Does that work, or do you need to be more specific?

Rick Gordon


On May 18, 2018 at 1:33:08 AM [-0700],
Matthew London wrote in an email entitled
"Re: Another Newbie GREP help request...":
I managed to figure out that the following would give me everything 
that had "from" followed by a capital letter, with a period followed 
by a space at the end:


from [A-Z][a-zA-Z].*[\. ]

But that also gives me all the sentences in the line which 
preceded the one I need!


How would I strip out all the sentences that precede the one I need?

___
RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___
WWW: http://www.shelterpub.com

--
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email

"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.