[comp.bugs.4bsd] re_comp and re_exec problem solved

cdash@mumm.colorado.edu (Charles Shub) (02/21/91)

In article <1991Feb20.051351.970@csn.org> I wrote...
=>  Have I found a bug in re_cmp and re_exec?  If so, is there a fix??
=>  if not, what am I doing wrong
=>  please respond by mail as I do not subscribe to this group.
=>  The problem seems to be in matching files with an input of <letter>*
=>  I get a random match in this case.
=>  
=>  Execution output
=>  ------------------------------
=>  bug m*
=>  enter a string >u*
=>  'u*' 'u.*'  'moutgoing'  found 1
=>  ------------------------------
=>   ^    ^      ^
=>   |    |      -------  file matched by re_exec
=>   |    --------------  string fed to re_comp
=>   -------------------  input string

There were 3 mail messages this am pointing out the regular expression
was not anchored and the correct expression to pass to re_comp should
be '^u.*' 
Ah the joys of terminal brain fade when you've been hard at it for
some 14 hours, have discovered a bug in some old code, and are thinking
about pattern matching in the context of globbing instead of regular
expression matching.  Thanks to all, and sorry to have wasted the net
bandwidth on something that should have been so obvious.
-- 

charlie shub  cdash@boulder.Colorado.EDU  -or-  ..!{ucar|nbires}!boulder!cdash
  or even     cdash@colospgs (BITNET)     -or-  (719) 593-3492