http://www.perlmonks.org?node_id=185372


in reply to Re: Re: Re: Re: look-behind regex
in thread look-behind regex

In this case, it's easy enough to ensure that $1 is not false. Even if zejames had wanted 'foo' not preceeded by '0' you could substitute  s/(0.*foo)|foo/($1,'bar')[!$1]/es