Skip to content
jonas054 edited this page Jun 3, 2011 · 5 revisions

Home

Rationale

The reason I wrote a find+grep style search tool is that I wanted something very similar to the find+grep combination with a bit of tailoring added for searching in source code. The functionality I wanted really needed an implementation made from scratch and couldn't be achieved just configuring and adding to find+grep.

Function

These are some of mlgrep's features, roughly in order of importance.

  1. Searches for matches across line breaks in texts. Since line breaks and other forms of white space are insignificant in many programming languages, this is necessary.
  2. Can find files recursively through directory trees, and recognizes a few file types and associates them with the correct languge. Differentiating between languages is necessary for skipping (see further down). Some languages such as C, C++ and Java are built-in. Others can be configured in ~/.mlgreprc.
  3. Adds some shorthand to the normal regex syntax. A single space means any combination of whitespace, and \u means "until".
  4. Can skip comments and strings when searching for matches.
Clone this wiki locally