AGREP - approximate GREP for fast fuzzy string searching. Files are searched for a string or regular expression, with approximate matching capabilities and user-definable records. Developed 1989-1991 by Udi Manber, Sun Wu et al. at the University of Arizona. ISC open source license since Sept. 2014.
C Makefile REXX
Permalink
Failed to load latest commit information.
archive renamed REXX program codepage.cmd to codepage.rexx Feb 17, 2013
docs new license Sep 27, 2014
installation archived older make- and doc files Feb 17, 2013
resources added legacy versions, docs, AGREP logo Feb 17, 2013
.gitignore version 3.412 -- compile for Windows using MXE cross-compile environment Aug 24, 2014
437.lst initial commit of AGREP 3.411 for LINUX Feb 17, 2013
850.lst initial commit of AGREP 3.411 for LINUX Feb 17, 2013
8859.lst initial commit of AGREP 3.411 for LINUX Feb 17, 2013
CHANGES new license Sep 27, 2014
COPYRIGHT new license Sep 27, 2014
Makefile adding function prototypes Aug 24, 2014
README.md new license Sep 27, 2014
agrep.8859.lst initial commit of AGREP 3.411 for LINUX Feb 17, 2013
agrep.algorithms initial commit of AGREP 3.411 for LINUX Feb 17, 2013
agrep.c fix issue #3 -B option shows wrong total number of results Aug 25, 2014
agrep.chronicle initial commit of AGREP 3.411 for LINUX Feb 17, 2013
agrep.h adding function prototypes Aug 24, 2014
agrephlp.c corrected the license text on help page 6 in the code Oct 22, 2016
asearch.c initial commit of AGREP 3.411 for LINUX Feb 17, 2013
asearch1.c initial commit of AGREP 3.411 for LINUX Feb 17, 2013
asplit.c initial commit of AGREP 3.411 for LINUX Feb 17, 2013
autoconf.h initial commit of AGREP 3.411 for LINUX Feb 17, 2013
bitap.c Correct typo when reading files Jul 28, 2015
bitap.c.orig initial commit of AGREP 3.411 for LINUX Feb 17, 2013
checkfil.c Enable OSX El Capitan build Jun 29, 2016
checkfil.h initial commit of AGREP 3.411 for LINUX Feb 17, 2013
checkfile.c initial commit of AGREP 3.411 for LINUX Feb 17, 2013
checkfile.h initial commit of AGREP 3.411 for LINUX Feb 17, 2013
checksg.c initial commit of AGREP 3.411 for LINUX Feb 17, 2013
codepage.c initial commit of AGREP 3.411 for LINUX Feb 17, 2013
codepage.h initial commit of AGREP 3.411 for LINUX Feb 17, 2013
compat.c initial commit of AGREP 3.411 for LINUX Feb 17, 2013
config.h version 3.412 -- compile for Windows using MXE cross-compile environment Aug 24, 2014
contribution.list initial commit of AGREP 3.411 for LINUX Feb 17, 2013
defs.h initial commit of AGREP 3.411 for LINUX Feb 17, 2013
delim.c initial commit of AGREP 3.411 for LINUX Feb 17, 2013
dummyfil.c initial commit of AGREP 3.411 for LINUX Feb 17, 2013
dummyfilters.c initial commit of AGREP 3.411 for LINUX Feb 17, 2013
dummysyscalls.c initial commit of AGREP 3.411 for LINUX Feb 17, 2013
follow.c adding function prototypes Aug 24, 2014
io.c Correct typo when reading files Jul 28, 2015
io.c.orig initial commit of AGREP 3.411 for LINUX Feb 17, 2013
main.c initial commit of AGREP 3.411 for LINUX Feb 17, 2013
maskgen.c initial commit of AGREP 3.411 for LINUX Feb 17, 2013
newmgrep.c Enable OSX El Capitan build Jun 29, 2016
ntdirent.c initial commit of AGREP 3.411 for LINUX Feb 17, 2013
ntdirent.h initial commit of AGREP 3.411 for LINUX Feb 17, 2013
parse.c adding function prototypes Aug 24, 2014
preproce.c initial commit of AGREP 3.411 for LINUX Feb 17, 2013
preprocess.c initial commit of AGREP 3.411 for LINUX Feb 17, 2013
putils.c initial commit of AGREP 3.411 for LINUX Feb 17, 2013
re.h initial commit of AGREP 3.411 for LINUX Feb 17, 2013
recursiv.c Enable OSX El Capitan build Jun 29, 2016
recursive.c initial commit of AGREP 3.411 for LINUX Feb 17, 2013
sgrep.c adding function prototypes Aug 24, 2014
unistd.h Revert "Add configuration to build on OSX" Jul 28, 2015
utilitie.c initial commit of AGREP 3.411 for LINUX Feb 17, 2013
utilities.c initial commit of AGREP 3.411 for LINUX Feb 17, 2013
version.h bump version 3.41.5 Jul 30, 2015

README.md

AGREP - an approximate GREP.

Fast searching files for a string or regular expression, with approximate matching capabilities and user-definable records.

Developed 1989-1991 by Udi Manber, Sun Wu et al. at the University of Arizona.

For Glimpse and WebGlimpse - AGREP is an essential part of them - see

Usage

Type

agrep

to get the six built-in help pages.

           Approximate Pattern Matching GREP -- Get Regular Expression
Usage:
AGREP [-#cdehi[a|#]klnprstvwxyABDGIRS] [-f patternfile] [-H dir] pattern [files]
-#  find matches with at most # errors     -A  always output filenames
-b  print byte offset of match
-c  output the number of matched records   -B  find best match to the pattern
-d  define record delimiter                -Dk deletion cost is k
-e  for use when pattern begins with -     -G  output the files with a match
-f  name of file containing patterns       -Ik insertion cost is k
-h  do not display file names              -Sk substitution cost is k
-i  case-insensitive search; ISO <> ASCII  -ia ISO chars mapped to lower ASCII
-i# digits-match-digits, letters-letters   -i0 case-sensitive search
-k  treat pattern literally - no meta-characters
-l  output the names of files that contain a match
-n  print line numbers of matches  -q print buffer byte offsets
-p  supersequence search                   -CP 850|437 set codepage
-r  recurse subdirectories (UNIX style)    -s silent
-t  for use when delimiter is at the end of records
-v  output those records without matches   -V[012345V] version / verbose more
-w  pattern has to match as a word: "win" will not match "wind"
-u  unterdruecke record output             -x  pattern must match a whole line
-y  suppresses the prompt when used with -B best match option
@listfile  use the filenames in listfile                              <1>23456Q

Branches

The present repository contains three different branches:

  • master: agrep based on agrep 3.0, ported to OS/2, DOS and Windows in the 90ies, and backported to LINUX (the present version you are visiting)
  • agrep3.0-as-found-in-glimpse4.18.6-20130216: agrep 3.0 as it was found in the glimpse software
  • agrep2.04: the first published and original agrep version

Installation

git clone git@github.com:Wikinaut/agrep.git
cd agrep
make

Algorithms

COPYRIGHT

As of Sept 18, 2014, Webglimpse, Glimpse and Agrep are available under the ISC open source license, thanks to the University of Arizona Office of Technology Transfer and all the developers, who were more than happy to release it.

Sources: http://webglimpse.net/sublicensing/licensing.html http://opensource.org/licenses/ISC

Anyone distributing the AGREP code should include the following license which is applicable since September 2014:

Copyright 1996, Arizona Board of Regents on behalf of The University of Arizona.

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.

IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Contributors

History

Alternatives to AGREP

Alternatives:

  • TRE is a lightweight, robust, and efficient POSIX compliant regexp matching library with some exciting features such as approximate (fuzzy) matching.
  • AGREPY: Python port of agrep string matching with errors
  • The bitap library , another new and fresh implementation of the bitap algorithm. Windows - C - Cygwin
  • PERL module String:Approx. Perl extension for approximate matching (fuzzy matching) by Jarkko Hietaniemi, Finland

Further stuff with the same name (agrep)

  • aGrep, published in 2012, is an Android implementation of grep (but not agrep).

Homepage and references