GREP --
Find Regular Expressions in Files
Revision History
program and documentation by Stan Brown, Oak Road Systems
version 4.93 beta, revised 25 April 2000
Copyright © 1986-2000 by
Stan Brown, Oak Road Systems
GREP is a filter that searches input files, or the standard input, for
lines that contain matches for one or more patterns called
regular expressions and displays those matching lines.
This document is the complete revision history, starting with the most
recent changes.
To use GREP, please see the user guide.
version 5.0, 2000-04-23:
- Add the
/R
option to read and
display files in binary mode
- Add the
/W
option to set the line width
(formerly fixed at 255 characters), and warn the user if longer lines
were found
- Add the
/Z
option to reset all
options
- Disallow out-of-order character ranges
like
z-a
; previously they were silently treated like the three
characters "z", "-", "a"
- Fix bug in 4.5: if you used wildcards with drive but no directory,
e.g.
d:*
, the drive was ignored
- Add new return values 2 and 252-254
- Expand the treatment of regular expressions in the
help message, and send it to stdout instead of stderr
as previously
- Don't display the help screens when the user types
grep
with no options or regular expression; instead,
issue an instruction to use grep /? |more
- When displaying a regular expression in debug mode, use a numeric
to show number of members in a character class
- Add an alphabetical index of options to
the user guide
v4.5, 1999-09-25 (general release):
v4.4, 1999-09-18 (limited release):
- Add the
/S
option for searching subdirectories (4.4)
- Add the
/A
option
for searching hidden and system files (4.4)
- Add a section to the user guide to describe input
files and redirection (4.4)
- Fix a bug: on the command line, regular expressions like
[\244-\246\248-\255]
,
with adjacent escaped 8-bit character ranges, were not expanded
correctly (4.5)
- Systematize the debugging output somewhat, in the course of fixing the
preceding bug (4.5)
- Fix a bug: on the command line,
\e
in regular
expressions was expanded to
Control-W (octal 27) instead of Escape (decimal 27) (4.5)
- Clarify and expand
"Special rules for the command line"
section of the user guide,
clarify the descriptions of
the
/D
and /I
options,
and add quite a few internal hyperlinks (4.5)
v4.3, 1999-08-04:
- Update contact information (new physical address and URL)
- Simplify registration options
- Add site license pricing
v4.2, 1999-02-20:
- Allow 8-bit characters in regular expressions
- Allow multiple regular expressions to be typed in directly, with
the
/F-
option
- Fix a bug: with
/I
, character classes entered in
lower case were expanded incorrectly
v4.1, 1999-01-22:
- Add the
/U
option (UNIX-style output) and the
/Q
option (quiet). Distinguish between option errors in
the environment variable and on the command line
- Make all output options toggles (except
/P
); diagnose conflicts
only after the last option has been scanned
- Take an optional output file name with
/D
(debug), which
is no longer a toggle
- Default
/P
(show context lines) to 2,2 if user specifies
/P
without numbers
- Honor the special escape sequences only
on the command line, since they're not needed when entering regular
expressions in a file
- Rewrite and greatly expand the user guide. Use HTML instead of MS
Word for Windows
v4.0, 1998-11-19:
- Package the existing version 4.0 for shareware release: revise
documents without changing the software
v4.0, 1998-05:
- Add the
/F
option (multiple regular expressions in a
file)
- Build a 32-bit version (to accept long filenames) along with
the 16-bit version, using a single set of source files
v3.4, 1998-03:
- With the
/P
option, remove the < > widgets
around the line numbers of the context lines, so that the lines
that actually match are more easily seen
v3.3, 1998-02:
- Add the
/L
option
- Accept options from an environment variable
- In the output, show the file path as specified on the
command line, not just the filename
- Prefix program messages with "grep:" or "grep/debug:"
- Add warning messages for incompatible or redundant sets of options
- Diagnose a regular expression containing
empty brackets
[]
as a user error, not an internal error
- Remove the
/S
option (search subdirectories), because
GREP's code now uses the C run-time library to interpret file specs on
the command line
- Fix a bug: inside
[...]
in regular expressions, the
backslash was swallowing an extra character
v3.2, 1997-06:
- Add the
/0
and /1
options to control
exit status
/D
now shows the number of matches in each
file, total matches, and exit status
v3.1, 1997-01:
- Allow numeric escapes like
\0x9A
, \045
,
and \211
in the regular expression
v3.0, 1996-12:
- Add the
/P
option (show context lines around the
actual matches)
- Display the values of all options when
/D
is on the command line
v2.4, 1990-04:
- Add
+
in regular expressions (match one or more
occurrences)
- Allow options both before and after the regular expression
- Add the
/S
option (search subdirectories)
v2.3, 1990-03:
- Reverse the meaning of the
/B
option: now the default
is to show only the names of matching files
- Suppress "matched 0 lines" when
/C
(count matches) is
specified and /B
is not
- Fix a bug:
[...]
character classes containing the range
character -
weren't always expanded correctly
v2.2, 1990-01:
- Add the
/B
option (show only the names of files that
contain matches)
v2.1, 1989-12:
- Make the
/D
option show the input pattern as well as
the decoded version
- Fix a bug: character classes
[...]
weren't working with
the /I
option
v2.0, 1989-07:
- Complete rewrite
- Add the
/I
option (ignore case)
- In the regular expression, add
\e
(escape) and
\q
(equal sign)
v1.0, 1986-04:
- initial version: Though all code was developed independently, I
got some ideas from PC Tech Journal, May 1996, pages
191-199.