home *** CD-ROM | disk | FTP | other *** search
/ Windows 95 Secrets (4th Edition) / Windows95Secrets4thEdition.iso / tools / searcher / grep32 / grep32.doc next >
Encoding:
Text File  |  1995-06-29  |  5.6 KB  |  130 lines

  1. GREP32 for WIN32    Version 1.1.0    June 28, 1995
  2.  
  3. This is a new version of GREP32.EXE for both Windows NT and Windows 95.
  4.  
  5. For the first version I promised a future version with a GUI.  Well,
  6. the GUI is still on my list of things to do.
  7.  
  8. Disclaimer & Copyright:
  9.  
  10.     Copyright (C) 1995  MarcNET.  All Rights Reserved.
  11.  
  12.     GREP32 is FreeWare!!
  13.  
  14.     THE INFORMATION AND CODE PROVIDED IS PROVIDED AS IS WITHOUT WARRANTY
  15.     OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  16.     THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  17.     PURPOSE. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DAMAGES
  18.     WHATSOEVER INCLUDIND DIRECT, INDIRECT, INCINENTAL, CONSEQUENTIAL,
  19.     LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF THE AUTHOR
  20.     HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  21.  
  22. Please send questions comments, suggestions to:
  23.  
  24.     
  25.             Marc Geist
  26.             945 Sparta Drive
  27.             Lafayette, CO  80026
  28.  
  29.             303-538-2653
  30.             mag@dr.att.com
  31.  
  32. History:
  33.     10-07-93    Version 1.0.0 First Released
  34.     06-26-95    Version 1.1.0 Released.
  35.                 Fixed problem where text in last line of file was not found if the last line
  36.                 was not properly terminated with a CR/LF.  Improved methed of reading input
  37.                 files.  Verified functionality with both Windows NT 3.51 and Windows 95 Final
  38.                 Beta.
  39.  
  40.  
  41. Quick overview of the GREP32 command line and regular expression syntax:
  42.  
  43. Usage:  grep [-bcilmnsvq? -dnnn] "pattern" file1 file2 ... [>ofile] [>>ofile]
  44.  
  45.     Options:
  46.       b    Each line is preceded by the block number of the file
  47.            in which it is found. (based on 512 byte blocks).
  48.       c    Only print the number of lines matched.
  49.       i    Ignore the case of each character while matching.
  50.       l    Only list the names of files containing a match
  51.            (or a nonmatch if 'v' option is selected).
  52.       m    Program prompts for search string (helps in search for ' and ")
  53.       n    Precede each printed line by its relative line
  54.            number in the file.
  55.       s    Suppress all error messages produced by non-readable files.
  56.       v    All lines but those matching are printed.
  57.       q    Suppress header information in output.
  58.       dnnn    Dump nnn lines of text including the string match line.
  59.       >    Will create new version of output file.
  60.      >>    Will append to output file if it exists or will
  61.            create it if it does not exist.
  62.       ?    Print this message plus more detailed information on
  63.            options and pattern matching.
  64.  
  65. If the 'm' option is specified, no search pattern is expected on command line.
  66.  
  67. Wildcards in specified file names are supported via the functionality
  68. provided by \MSVCNT\LIB\SETARGV.OBJ (read your MSC documentaion for a
  69. description of this).
  70.  
  71. Options can be placed anywhere on the command line and they are additive.
  72. The first occurance of an argument not preceded by '-' will be acknowledged
  73. as the pattern string to be searched for unless the 'm' option has been
  74. specified.  Any other arguments not preceded by '-' will be taken as
  75. filenames.  The minimum number of arguments must contain at least a pattern
  76. string and a filename or the 'm' option and a filename.  If no options are
  77. specified the default condition is an exact pattern search in the filename(s)
  78. specified with all matching lines printed to the screen.
  79.  
  80. How to construct special regular expression search patterns:
  81.  
  82.   Special Characters:
  83.  
  84.         *  Wildcard that matches any character or number of characters.
  85.         .  (period) matches any one character.
  86.         ^  (caret) at the beginning of a pattern constrains the pattern
  87.            to a match the initial segment of a line.
  88.         $  (currency sign) at the end of a pattern constrains the
  89.            pattern to a match the final segment of a line.
  90.         [  Used to "begin-block" a string of characters for special one-
  91.            character matches.
  92.         ]  Used to "end-block" a string of characters for special one-
  93.            character matches.
  94.         \  Backslash followed by any special character will match that
  95.            special character (i.e. "\[" will match the character '[').
  96.  
  97.   Special Constructs:
  98.  
  99.         [str]  A non-empty string of characters enclosed by square brackets
  100.            will match any one character in the string.
  101.        [^str]  A non-empty string of characters enclosed by square brackets
  102.            and preceded by a "caret" will match any character except
  103.            the characters in the string.
  104.         -  (hyphen) may be used to indicate a range of consecutive
  105.            ascii characters (i.e [0-9] = [0123456789].  The '-' loses
  106.            its special meaning if it occurs after an initial '^' or is
  107.            located last in the string.
  108.             \{m\}
  109.            \{m,\}
  110.           \{m,n\}  A one character expression followed by \{m\}, \{m,\}, or
  111.            \{m,n\} is an expression that matches a range of occurances
  112.            of the one character expression.  Values of m and n must be
  113.            non-negative integers less than 256.  \{m\} matches exactly
  114.            m occurances, \{m,\} matches at least m occurances, and
  115.            \{m,n\} matches any range of occurances between m and n
  116.            inclusive.
  117.    \(expression\)  An expression enclosed between \( and \) is an expression
  118.            that matches whatever the unadorned expression matches.
  119.            \n  The expression \n matches the same string of characters as
  120.            was matched by an expression enclosed between \( and \)
  121.            earlier in the same expression.  n is a digit and the sub-
  122.            expression specified is associated with the n-th
  123.            occurance of \( counting from the left.  For example the
  124.            expression: \(test\).*\1 matches a line containing at least
  125.            two occurances of the string "test".
  126.  
  127.     A concatenation of expressions is an expression that matches the con-
  128.     catenation of the strings matched by each component of the expression.
  129.  
  130.