Article View: comp.bugs.4bsd
Article #329re_comp and re_exec problem solved
From: Charles Shub
Date: Wed, 20 Feb 1991 17:42
Date: Wed, 20 Feb 1991 17:42
30 lines
1806 bytes
1806 bytes
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
Technical Details
Message-ID:
<1991Feb20.174215.27365@csn.org>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!csn!newsReferences:
<1991Feb20.051351.970@csn.org>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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