This page has been updated on July 1, 2002
AGREP [options] [-f patternfile] pattern
[files]
searches all files in the current directory for any occurences of the pattern Madonna. As AGREP searches are case-sensitive by default, here it would find abcMadonnaxyz but it would not find abcmadonnaxyz.
would both find Résumé, RÉSUMÉ, resume, Resümee (and also e.g. rèsümê)
The -ia option maps characters with accents or "Umlauts" to the corresponding unaccented letter. The German ß as in Straße (meaning street) is treated as a single s.
-# find matches with at most # errors -A always output filenames -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 output record prefixed by line number -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" -x pattern must match a whole line -y suppresses the prompt when used with -B option @listfile use the filenames in listfileback to the top of this page
\z | turns off any special meaning of character z (\# matches #) |
^ | begin-of-line symbol |
$ | end-of-line symbol |
. | matches any single character (except newline) |
# | matches any number > 0 of arbitrary characters |
(×)* | matches zero or more instances of preceding token × (Kleene closure) |
×(×)* | matches one or more instances of preceding token × (Positive
closure)
(Use this as replacement for (×)+ which is not implemented yet.) |
Sets |
|
[b-dq-tz] | matches characters b c d q r s t z |
[^b-diq-tz] | matches all characters except b c d i q r s t z |
ab|cd | matches "ab" or "cd" |
<abcd> | matches exactly, no errors allowed in string "abcd"
(overrides the -1 option) |
Operators (and, or) |
|
The operators ; (and) and , (or) must not appear together in a pattern. | |
cat;dog | matches records having "cat" and "dog" |
cat,dog | matches records having "cat" or "dog" |
The Kleene closure of the language
A is the language formed by the union of zero and more concatenations
of A.
The Positive closure of the language
A is the language formed by the union of one and more concatenations
of A.
back to the top of this page
back to AGREP
case-insensitive search for needle in file foo with no output at all.
The -V0 option even avoids the display of number of "Grand Total" matches.
back to the top of this page
back to AGREP
>x.x AGREP "string\\\"" *.c
Comments:
The sequence \\\" appears in AGREP as \" (this means: search for ").
The output redirection part >x.x is moved to the start of the command line to avoid any problems of command line parsing by the operating system and/or compiler specific problems.
back to the top of this page
back to AGREP