BBEdit: find / replace in selection

Solution 1:

"Use Selection for Find" and "Use Selection for Replace" are right there in the Search menu.

Solution 2:

From page 183 of the manual for v14.0:

Replace All in Selection
This command is enabled only when there is a selection in the frontmost text document (or in the text document immediately behind the Find window). Choosing it will perform a Replace All upon the selected range of text, i.e. it has the same effect as enabling the Selected Text Only option in the Find window.

It's there in v14, v13 and v12.

Also, I contacted the developers of BBEdit and they gave this answer in response to the exact question the OP gave:

  • make the desired selection, then

  • bring up the Find window (Command-F),

  • enter the desired search & replace strings (or patterns),

  • turn on the "Selected text only" option, and

  • click "Replace All".

and to underline what was already stated above from the manual:

i.e. it has the same effect as enabling the Selected Text Only option in the Find window.