Projects / Grep.pm

Grep.pm

Grep.pm is a much-modified fork of tcgrep. It understands context, matching from the start or end of a file (with a line count or byte count), and features size limits and highlighting. It extends matching to boolean expressions, structuring regular expressions, or even arbitrary pieces of Perl code. It can perform basic stemming and synonym-expansion in regular expressions (using expansyn). It also handles \0-lines, paragraphs, file slurping, directory recursion, and compressed files. It can act either as a Perl module or a command-line program. Grep.xchange is a support program taking grep or Grep.pm input and applying an expression at each grep match to the files specified in the grep output. This expression can be arbitrary Perl modifying e.g. just the line of the match with s///g, or operate against the current pos() position in the whole file. Grep.xchange --modified goes one step further and replaces the matched lines with the (edited) text from the grep output. Changes are logged in diff -u format and can be revoked/redone with patch.

Tags
Licenses
Operating Systems
Implementation

Recent releases

  •  13 Sep 2009 16:52

    Release Notes: This release fixes parsing of the -b option.

    •  30 Aug 2009 01:10

      Release Notes: This version was restructured as a Perl module.

      Recent comments

      27 Aug 2009 22:09 jakobi2

      Note that Grep.xchange maintains an UNDO log in diff -u format. Thus patch -u < LOG can be used to undo the change for all files involved. Or with -R you can apply the same changes to another set of files.

      Screenshot

      Project Spotlight

      OpenStack4j

      A Fluent OpenStack client API for Java.

      Screenshot

      Project Spotlight

      TurnKey TWiki Appliance

      A TWiki appliance that is easy to use and lightweight.