テキストエディタ(Jedit)の検索/置換機能で次のことを行うために使用できる正規表現はありますか?
次の条件を満たすテキストファイルの行に一致します。
- 行は閉じ括弧で終わります
- 開き括弧は同じ行のどこかにあります
一致する場合は、行のすべてのテキストを折り返す必要がありますが、行の先頭に空白はありません#
。
例1
この行:
Total reimbursements (before end of Q1)
これに置き換える必要があります:
#Total reimbursements (before end of Q1)#
例2(先頭の空白)
この行(Totalという単語の前に空白がある場合):
Total reimbursements (before end of Q1)
これに置き換える必要があります(#記号は行の最初の文字の前に配置されます):
#Total reimbursements (before end of Q1)#
しかし、これではありません:
# Total reimbursements (before end of Q1)#
サンプルテキストファイル:
Base Expenses
&&&&&&&&&&&&&&&&&&&&&&&
Provides options towards multilateral improvements
Opening Debt(Option patterns)
A copy provided externally
Customer Summary
&&&&&&&&&&&&&&&&&&&&&&&&&
External Console(foreign debt)
Provide execution amounts
Internal Console(domestic debt)
Release to appropriations committee
Explanations provided to external clients
Neutralized Amounts()
Forex portion