\s* stands for zero or more whitespace characters, including \n and \r 
(newlines).

Two ways (at least) to get what you want:

1. Instead of \s, use a character class. [ \t] defines a character class with a 
spacebar space and a tab.

* All of these start at beginning of line due to ‘^’ anchor.

  ^[ \t]*print # zero or more spaces or tabs before ‘print’ 

  ^[ \t]print  # one tab or space before ‘print'

  ^[ \t]+print # one or more spaces or tabs before ‘print'


2. Use \h instead of [ \t] or \s; \h stands for horizontal whitespace, applies 
more widely to horizontal whitespace characters.

  ^\h*print

  ^\hprint

  ^\h+print

HTH

    — Bruce

_bruce__van_allen__santa_cruz_ca_





> On Sep 20, 2023, at 8:40 PM, John Mitchell <[email protected]> wrote:
> 
> my search string is:  ^\s*print
> my replace string is:  #\0
> 
> however it goes over the end of a blank line to connect with a next "print..."
> How do I stop the multiline operation?
> 

-- 
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/4527CCE8-579E-42FD-A393-465F14A95132%40cruzio.com.

Reply via email to