home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume29 / regex-glob / part01 / README < prev   
Encoding:
Text File  |  1992-04-06  |  2.2 KB  |  50 lines

  1. 02-20-91 Seattle, WA
  2.  
  3.  
  4. Here is a *IX wildcard globber I butchered, hacked and cajoled together
  5. after seeing and hearing about and becoming disgusted with several similar
  6. routines which had one or more of the following attributes:  slow, buggy,
  7. required large levels of recursion on matches, required grotesque levels
  8. of recursion on failing matches using '*', full of caveats about usability
  9. or copyrights.
  10.  
  11. I submit this without copyright and with the clear understanding that
  12. this code may be used by anyone, for any reason, with any modifications
  13. and without any guarantees, warrantee or statements of usability of any
  14. sort.
  15.  
  16. Having gotten those cow chips out of the way, these routines are fairly
  17. well tested and reasonably fast.  I have made an effort to fail on all
  18. bad patterns and to quickly determine failing '*' patterns.  This parser
  19. will also do quite a bit of the '*' matching via quick linear loops versus
  20. the standard blind recursive descent.
  21.  
  22. This parser has been submitted to profilers at various stages of development
  23. and has come through quite well.  If the last millisecond is important to
  24. you then some time can be shaved by using stack allocated variables in
  25. place of many of the pointer follows (which may be done fairly often) found
  26. in regex_match and regex_match_after_star (ie *p, *t).
  27.  
  28. No attempt is made to provide general [pat,pat] comparisons.  The specific
  29. subcases supplied by these routines is [pat,text] which is sufficient
  30. for the large majority of cases (should you care).
  31.  
  32. Since regex_match may return one of three different values depending upon
  33. the pattern and text I have made a simple shell for convenience (match()).
  34. Also included is an is_pattern routine to quickly check a potential pattern
  35. for regex special characters.  I even placed this all in a header file for
  36. you lazy folks!
  37.  
  38. Having said all that, here is my own reinvention of the wheel.  Please
  39. enjoy it's use and I hope it is of some help to those with need ....
  40.  
  41.  
  42.                                 jbk
  43.  
  44. From: johnk@wrq.com
  45. Date: 22 Feb 91 01:15:43 GMT
  46. Organization: Walker Richer & Quinn, Inc., Seattle, WA
  47.  
  48. John Kercheval -- 127 NW Bowdion Pl #105 -- Seattle, WA  98107-4960
  49. Home(Voice): (206) 547-4676  --------  Work (Voice): (206) 324-0350
  50.