> On Feb 1, 2016, at 2:50 AM, Scott Barman <[email protected]> wrote:
> 
> In vi (and ed), I could search for a pattern, then on every line found, run a 
> substitute command using a different pattern.
> 
> For example, if I want to find every line with a colon and change it so that 
> the line is a level 3 header, in ed or vi I could do: g/:/s/^.*$/<h3>&<\/h3>

For your specific problem:

Cmd-F (or Search > Find…).
In the Find box:      ^.*:.*$
In the Replace box:      <h3>&</h3>
Click Replace All 

I don’t know if there is a solution for the more general case of “For every 
line containing X do Y” without falling back to AppleScript. It is something I 
have wanted to do occasionally, and I think I usually end up with some 
workaround. The Text > Process Lines Containing command lets you select lines 
based on a regular expression, but the only processing it can do is to delete 
matching or non-matching lines and/or copy them to the clipboard or to a new 
document.

Regards,

        Neil Faiman

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.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 post to this group, send email to [email protected].

Reply via email to