On 04/26/2021, at 18:37, David J <[email protected] 
<mailto:[email protected]>> wrote:
>  I'm trying to take out any empty lines from a document and can't figure out 
> why it's not working. 
> 
> I'm adding the text, then selecting all then adding grep
> 
> ^\s*?\r      
> 
> then replace all with nothing. I'm getting "not found" on any document. 
> Weirdly, I swear this was working before. Can anyone give some insight here?


Hey David,

Why are you selecting-all?

Adding grep where?

Your pattern above works with normal text and blank lines.

Although I would use a capital R to represent more types of line endings:

^\s*?\R

The fact nothing is working for you might be explained by:

1) You've turned OFF [ ] Grep in the Find dialog.

2) You are selecting-all and then using Cmd-G to try to find without 
Wrap-Around active.

Another thing – blank lines are often NOT blank.  Very frequently some 
whitespace has crept in that needs to be accounted for, and it is also common 
for normal lines to have accidental trailing whitespace.

So – I would manage this be removing any trailing whitespace and blank lines at 
the same time:

Find:

\h*\v\s+

Replace:

\n

--
Best Regards,
Chris

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/CF3AB8A5-026E-46EB-8638-B5FAA450E08E%40gmail.com.

Reply via email to