Regular expression in JEdit

JEdit is an excellent editor and includes search and replace with regular expressions. For subexpressions in the replacement area is using dolar sign $ instead of backslash \. Here is a small example. Second occurence of substring cv needs to be replaced by substring s1.

String: array(‘ab’ => ‘156.2’, ‘cv’ => ‘99.9999’, ‘cv‘ => ‘9.9999),
Search for:(.*?cv)(.*)cv(.*)
Replace with:$1$2s1$3

New string: array(‘ab’ => ‘156.2’, ‘cv’ => ‘99.9999’, ‘s1‘ => ‘9.9999),

This entry was posted in workday. Bookmark the permalink.

Leave a Reply