re_comp and re_exec problem solved

Charles Shub cdash at mumm.colorado.edu
Thu Feb 21 04:42:15 AEST 1991


In article <1991Feb20.051351.970 at 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 at boulder.Colorado.EDU  -or-  ..!{ucar|nbires}!boulder!cdash
  or even     cdash at colospgs (BITNET)     -or-  (719) 593-3492



More information about the Comp.unix.wizards mailing list