是否可以在文本编辑器 (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