On Aug 21, 2007, at 8:27 AM, Chris Pepper wrote:

I believe BBEdit can do this, but I have been unable to parse the answer out of "Conditional Subpatterns" in the Help's "Searching with Grep", and suspect it's simple for folks here. I need to unwrap configuration stanzas for a Big-IP load balancer. I want to perform either one of 2 transformations:

a) If the last character on a line *is not* '}': remove the next return. b) If the last character on a line *is* '}': leave the return, and add 'b ' before the next line.

I think Search For should be '(.)\r', but I haven't been able to gin up a suitable Replace With.

        Suggestions?

I'm happy to be contradicted, but I don't think conditional subpatterns will support conditional replacement. This is either a job for a filter (eg Perl) or a two-pass replacement:

a. find ([^}])\r        replace \1
b. find }\r     replace }\rb

--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to