You can tailor your regular expression to only find one match. I use [\s\S]* to 
defeat the tendency of .* to match only within a single line.

replace "([\\s\\S]*?)find string([\\s\\S]*)" using "\\1replace string\\2" 
searching in text 1 of project window 1 options {search mode:grep, starting at 
top:true}

Or, you can do a find, capturing it into the current selection, and then do a 
replace within that selection.

find "find string" searching in text 1 of project window 1 options {starting at 
top:true} with selecting match
replace ".*" using "replace string" searching in selection of project window 1 
options {search mode:grep}

Hope this helps,

[fletcher]


> On May 26, 2020, at 9:36 PM, Hal Day <[email protected]> wrote:
> 
> I am learning to use AppleScript for BBEdit to do find/replace editing. I 
> find that replace does "replace all", and have not discovered how one does a 
> single find/replace.
> 
> Could someone explain that, and could someone tell me where to get good, 
> detailed information on this topic. I find the BBEdit manual very brief on 
> AppleScripting.
> 
> My thanks.
> 
> -- 
> 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/b86c8a49-c777-4548-a77c-3c322df45697%40googlegroups.com.

-- 
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/4E6BF96C-6D6E-4470-B32B-A74BF36FBD47%40cumuli.com.

Reply via email to