Chris~
The problem with using '(.)\r' as your search string is that it will
find any character at the end of a line -- but you want to know if
the last character before the end of line contains (or does not
contain) a right brace: }
Therefore, you have to include the brace as part of your search pattern.
For the first type of your specified search in Grep-enabled BBEdit, try:
search for: ^\}$\r
replace with:
That will "move up" the line following the brace-ending line and join
it right next to the brace that previously ended that line.
For the second type of your specified search in Grep-enabled BBEdit,
try:
search for: \}$\r
replace with: \rb
(That's a newline, the letter "b", and a trailing space.)
~Semper Fi, Mac!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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?
Thanks,
Chris
--
Chris Pepper: <http://www.reppep.com/~pepper/>
<http://www.extrapepperoni.com/>
The Rockefeller University: <http://www.rockefeller.edu/>
--
------------------------------------------------------------------
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]>
--
------------------------------------------------------------------
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]>