Match Edit


matchedit - edit regions of files that match a (Perl) regular expression in a single session


matchedit [--context num] [--editor editor] regexp file...


matchedit allows you to edit the regions of the specified files that match the (Perl) regular expression regexp.


--context num-C num
Print num lines of context before and after each match.
--editor editor
Use editor to edit the matches. If this option is not given the editor defaults to the one specified with environment variable EDITOR or vim.

Bugs and Caveats

The markup of the file holding the matches is neither nice nor fool-proof. This means that your edited section may contain markup that confuses this script. This is not guarded against (yet), but for each changed file the script generates a backup copy, so in case of unexpected trouble you may recover.


(C) 2000-2005 Mark Hillebrand .

This code is released under the BSD License. Before using this software, visit for the full license text.


Page MatchEdit
Revision 03 May 2005
Parents: Index