Xref: utzoo comp.bugs.4bsd:1758 comp.unix.wizards:24192 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!csn!news From: cdash@mumm.colorado.edu (Charles Shub) Newsgroups: comp.bugs.4bsd,comp.unix.wizards Subject: re_comp and re_exec problem solved Message-ID: <1991Feb20.174215.27365@csn.org> Date: 20 Feb 91 17:42:15 GMT References: <1991Feb20.051351.970@csn.org> Sender: news@csn.org (news) Organization: University of Colorado at Colorado Springs Lines: 30 Nntp-Posting-Host: mumm.colorado.edu 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 * => 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