JEdit, powerful search and replace using BeanShell
JEdit is my favorite text editor. And today I was pleased to find some powerful scripting capability in its search and replace functionality. Basically I wanted to enclose a RegularExpression pattern with:
<a href="">PATTERN</a>
The Search and Replace dialog provided an option Return value of a BeanShell snippet. So whatever RegularExpression pattern grouping I provided, I was able to access them using the BeanShell variable _1 to _9. So my final replace statement became:
"<a href\"\">" + _1 + "</a>"
Cool solution to a simple problem.

$1 is simpler. You don’t have to use escape characters.
Ino
8 Jan 10 at 11:02 am