Newsgroups: comp.lang.perl Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!ukma!usenet.ins.cwru.edu!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery KF8NH) Subject: Re: regular expressions Reply-To: allbery@ncoast.ORG (Brandon S. Allbery KF8NH) Organization: North Coast Public Access Un*x (ncoast) Date: Sat, 8 Jun 1991 14:54:19 GMT Message-ID: <1991Jun8.145419.22522@NCoast.ORG> Followup-To: comp.lang.perl References: <1991Jun4.175023.6509@serval.net.wsu.edu> Lines: 29 As quoted from <1991Jun4.175023.6509@serval.net.wsu.edu> by hakimian@tek4.eecs.wsu.edu (Karl Hakimian - staff): +--------------- | I would like to talk with and and all regular expression gurus. It seems that | the regular expressions that are supported by perl (and unix) do not accept | any and all regular languages. If this is not true, I would love to learn how | to do some of the things that I am trying to do. +--------------- It's true, which is why Perl will never replace, say, Icon for *all* applications. +--------------- | For example, how would you write a regular expression that accepts a string | with "foo" iff "bar" is not also in the string. +--------------- You don't. Regexps are most capable in combination with other constructs; so, while you can't write a regexp that matches /foo/ iff it does not also match /bar/, you *can* say (in Perl): (($str !~ /bar/) && ($str =~ /foo/)). (I could argue that Perl is nothing more than an extended regexp parser, if I were feeling whimsical....) ++Brandon -- Me: Brandon S. Allbery KF8NH: DC to LIGHT! [44.70.4.88] Internet: allbery@NCoast.ORG Delphi: ALLBERY uunet!usenet.ins.cwru.edu!ncoast!allbery