Archive for the ‘jedit’ tag
JEdit Macro for XML/HTML Special Character Conversion
One of the common requirement I face often when posting text to blog/forum/Wiki etc. is character conversion:
| & | & |
| < | < |
| > | > |
| " | " |
| ' | ' |
I developed a small JEdit Macro for doing this. This macro can be executed from JEdit menu Macros > Run Other Macro..., or can be installed by copying to: ${user.home}/.jedit/macros/ (later executed from the menu Macros). This macro operates on selected text.
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.
