GREP — Find Regular Expressions in Files
Overview
Program release 8.01 dated 9 Dec 2021
Copyright © 1986–2022 by Stan Brown, BrownMath.com
What is GREP?
GREP searches for strings or regular expressions in files. Patterned
after the UNIX utility fgrep, it’s also a vastly superior
replacement for the DOS utility FIND. GREP runs on the command line in
all versions of Windows.
You can find full details in the
GREP Quick Start Guide
and GREP Reference Manual, but here are highlights:
- GREP searches for strings, basic regular expressions, or (in
32-bit GREP) extended regular expressions involving |, {m,n}, ?, and
more. For example, with FIND if you search for “the” you’ll also get
matches for “these” and “mother”. Regular expressions let you screen
out such false matches.
- GREP can search for multiple strings or regular expressions
in one pass, from the keyboard or stored in a file. You can specify
AND, OR, NOT ALL, or NONE logic.
- GREP searches text or binary files in DOS/Windows, UNIX,
and Macintosh formats.
GREP can even figure out whether each
file is text or binary.
- GREP can search by line or paragraph, by
binary record, or in free-form binary.
- GREP will search a whole subdirectory tree if you
want.
- GREP honors DOS wildcards and UNIX globbing to
specify which files to search and which to exclude from
searching.
- Output is similar to DOS FIND or UNIX grep (your choice). Several
options let you customize the output.
For instance, instead of matching lines you can get counts of matches,
or just the matches without the full lines, or just the names of files
that contain matches.
On the other hand, you can ask for context lines before and
after each line that actually contains a match.
- GREP is useful in batch scripts and makefiles. You can
tell it to return 0 for match and 1 for no match or the other way
around; then your .bat
or .cmd file or makefile can decide what to do next.
How do I get GREP?
Download
the program, all docs, and an interactive tour as a 579 KB ZIP file.
After downloading, unzip the file
in any convenient directory and read the 0readme.1st file.
Need an unzip program?
I use and recommend 7-Zip (freeware, open
source) for Windows. It also includes a command-line version.
Installation instructions
and system requirements
are here.
How do I buy GREP?
There is no charge for the program. If you try it and find that it
meets your needs, please make a donation, to
thank the program author and to help with the cost of web hosting.
License and Warranty
GREP was formerly shareware, but is now distributed as
freeware. All features of the former registered version are present in
the freeware version.
If you find that GREP meets your needs,
please make a donation to reward the
program author and also support hosting fees on the Web.
Although I am not aware of any bugs in GREP, it is
offered without warranty. Nevertheless, if you do find a bug,
please
report it.
What’s New?
- These are just the most significant changes in
the last few releases. Complete release notes for each release are in
the GREP Revision History.
- Release 8.01 (9 Dec 2021): GREP moved here to
BrownMath.com from its original home on OakRoadSystems.com.
Documentation was improved a little bit, and the program logo line
was updated with the new Web address, but there were no significant
changes except: the GREP Quick Reference Card is now a PDF instead of a Word
file, documents were added back to the download file, and the file was
structured with subdirectories.
- 2 July 2020: All documentation is now on the Web, including
the GREP Quick Reference Card.
- 3 Feb 2019: Release 8.0 of GREP became freeware.
Donations are encouraged, but you no longer have to pay to unlock
all features.
- Release 8.0 (5 May 2005) now recognizes all line-ending
conventions in text files, adds the letter /o option to let you
specify output format, extends the /P option to give
context bytes in binary files, and adds the /3 option to let
batch files and makefiles check whether GREP issued any warnings. The
interactive tour now works in a Windows XP command prompt.