Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!hplabs!hpcc01!hpccc!weisberg From: weisberg@hpccc.HP.COM (Len Weisberg) Newsgroups: comp.lang.perl Subject: Re: how long is a {0,m} match? Message-ID: <12170010@hpccc.HP.COM> Date: 3 Aug 90 22:06:20 GMT References: <12170008@hpccc.HP.COM> Organization: HP Corp Computing & Services Lines: 26 A few days ago I asked a question in a rather long form. Let me try again a bit more concisely: Here's another bit of confusing regexp behavior: ------------------------------------------------------------------------------ pattern: applied to: matches: /a{1,4}/ 'aaay' 'aaa' /a{1,4}/ 'xaaay' 'aaa' /a{0,4}/ 'aaay' 'aaa' /a{0,4}/ 'xaaay' '' ( ... more examples that fit the same pattern) ------------------------------------------------------------------------------ If there is some general principle about longest match, it seems to break when 0 repetitions match, but only when the match is not at the start of the string. Does this make sense? Is it a bug? Any enlightenment appreciated. Thanks, - Len Weisberg - HP Corp Computing & Services - weisberg@corp.HP.COM