home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 329_01 / egrep.doc < prev    next >
Text File  |  1988-12-09  |  4KB  |  136 lines

  1.  
  2.  
  3.  
  4.           EGREP (3)                  local                   EGREP (3)
  5.  
  6.  
  7.      NAME         NAME  
  8.  
  9.           egrep 
  10.  
  11.      SYNOPSIS         SYNOPSIS  
  12.  
  13.                egrep [flags] regular_expression file_list
  14.  
  15.                Flags are single characters preceeded by '-':
  16.                -c      Only a count of matching lines is printed
  17.                -f      Suppress printing filename before matching lines
  18.                -n      Each line is preceeded by its line number
  19.                -v      Only print non-matching lines
  20.                
  21.  
  22.           DESCRIPTION              DESCRIPTION  
  23.  
  24.                This  is a MS-DOS version of the Unix egrep(1) command,
  25.                using Henry  Spencer's  regular  expression  functions.
  26.                Most  of  the rest of this documentation is copied from
  27.                the manual page for regexp(3).  
  28.  
  29.           REGULAR EXPRESSION SYNTAX              REGULAR EXPRESSION SYNTAX  
  30.  
  31.                A  regular  expression  is  zero  or   more   branches,
  32.                separated by `|'.  It matches anything that matches one 
  33.                of the branches.  
  34.  
  35.                A branch  is  zero  or  more  pieces, concatenated.  It
  36.                matches a match for the first, followed by a match  for
  37.                the second, etc.  
  38.  
  39.                A  piece  is  an atom possibly followed by `*', `+', or
  40.                `?'.  An atom followed by `*' matches a sequence  of  0
  41.                or more  matches  of the atom.  An atom followed by `+'
  42.                matches a sequence of 1 or more matches  of  the  atom.
  43.                An atom followed by `?' matches a match of the atom, or 
  44.                the null string.  
  45.  
  46.                An   atom   is  a  regular  expression  in  parentheses
  47.                (matching a match for the regular expression), a  range
  48.                (see  below),  `.' (matching any single character), `^'
  49.                (matching the null string at the beginning of the input 
  50.                string), `$' (matching the null string at  the  end  of
  51.                the input string), a `\' followed by a single character 
  52.                (matching  that  character), or a single character with
  53.                no other significance (matching that character).  
  54.  
  55.                A range is a sequence of characters enclosed  in  `[]'.
  56.                It  normally  matches  any  single  character  from the
  57.                sequence.  If the sequence begins with `^', it  matches
  58.                any   single   character  not  from  the  rest  of  the
  59.                sequence.   If  two  characters  in  the  sequence  are
  60.                separated  by  `-', this is shorthand for the full list
  61.                of ASCII characters between them (e.g. `[0-9]'  matches
  62.                any decimal  digit).    To include a literal `]' in the
  63.                sequence, make it  the  first  character  (following  a
  64.                possible `^').    To include a literal `-', make it the
  65.  
  66.  
  67.                                       -1-
  68.  
  69.  
  70.  
  71.           EGREP (3)                  local                   EGREP (3)
  72.  
  73.  
  74.                first or last character.  
  75.  
  76.           SEE              SEE  
  77.  
  78.                fgrep(3) 
  79.  
  80.           DIAGNOSTICS              DIAGNOSTICS  
  81.  
  82.  
  83.           HISTORY              HISTORY  
  84.  
  85.                The regular expression functions were posted to  Usenet
  86.                by  Henry  Spencer  of  University of Toronto. The main
  87.                program comes from the  DECUS  grep  with  its  pattern
  88.                matching ripped out.  
  89.  
  90.                The  program  was  compiled  using Microsoft C 4.0, and
  91.                linked so that ambiguous filenames are expanded.  
  92.  
  93.                This release was put together by Kent Williams.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.                                       -2-
  135.  
  136.