home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 1 / FishNMoreVol1.bin / more / programming / arpprog / newdocs / patternmatch < prev    next >
Text File  |  1988-02-22  |  2KB  |  133 lines

  1.  
  2.  
  3.  
  4.      PatternMatch(33.4)      ARP Programmers Manual    PatternMatch(33.4)
  5.  
  6.  
  7.  
  8.      NAME
  9.       PatternMatch - perform a wildcard match on a string
  10.  
  11.      SYNOPSIS
  12.       result = PatterMatch(pat,str)
  13.          D0            A0 A1
  14.  
  15.      FUNCTION
  16.       This function    compares a string to the given pattern and
  17.       determines if    it is a    valid match.  If so it returns a true
  18.       result.  If you are calling FindFirst()/FindNext() this
  19.       function, and    the related PreParse() function    are called for
  20.       you.    You will need this function to do pattern matching on
  21.       arbitrary text, for example, in a Search command in a    text
  22.       editor, or in    implementing a 'grep' program.    The pattern
  23.       must be constructed with special preparsed tokens and
  24.       supports the following patterns:
  25.  
  26.           (p1|p2|p3)  One of the patterns p1, p2 or p3
  27.  
  28.           ?          Any single character
  29.  
  30.           #<pat>      Pattern repeated 0 or more times
  31.  
  32.           [class]     Character    class
  33.  
  34.           [^class]    Negated character    class
  35.  
  36.           {pat}          Structure    tag for    replacement
  37.  
  38.           *          0    or more    occurances of any character
  39.  
  40.      INPUTS
  41.       char *pat - The pattern string to match against, this    is
  42.           only partially ascii,    the wildcard strings must be
  43.           converted to the appropriate token value as given in
  44.           the arpbase.[ih] files. The easiest way to do    this
  45.           is to    pass the string    to PatternMatch() (V33 of
  46.           arp.library).
  47.  
  48.       char *str - The string to be matched
  49.  
  50.      RESULT
  51.       result - a boolean value indicating success/failure.
  52.  
  53.      BUGS
  54.       Character classes still do not work.
  55.  
  56.      SEE ALSO
  57.       PreParse(), FindFirst(), FindNext(), FreeAnchorChain()
  58.  
  59.      AUTHOR
  60.  
  61.  
  62.  
  63.      Page 1                         (printed 2/22/88)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      PatternMatch(33.4)      ARP Programmers Manual    PatternMatch(33.4)
  71.  
  72.  
  73.  
  74.       JAT
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  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.      Page 2                         (printed 2/22/88)
  130.  
  131.  
  132.  
  133.