Hi David,

Can it be that your file has Unix line breaks and you are trying to match 
carriage returns?

There are 3 forms of line breaks:

• Unix (LF - linefeed) that can be matched with \n
• Legacy Mac (CR - carriage return) that can be matched with \r
• Windows (CRLF) that can be matched with \r\n

Furthermore PCRE regular expressions have the following generic character 
types:

 • \s any white space character
 • \h any horizontal white space character
 • \v any vertical white space character

PCRE documentation: https://www.pcre.org/original/doc/html/pcrepattern.html

This regex should match any number of contiguous empty lines for the 3 
types of line breaks:

    ^\s*\v 
    
And those, single empty lines:

    ^\s*?\v  (your initial intent)
or
    ^\h*\v
    
HTH

Jean Jourdain


On Tuesday, April 27, 2021 at 1:37:04 AM UTC+2 David J 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? 
>   
>

-- 
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/6c1aecac-18be-4159-aa7d-274273109ae9n%40googlegroups.com.

Reply via email to