develooper Front page | perl.perl5.porters | Postings from October 2015

Re: [perl #116639] regex optimiser wrongly rejects certain matchesinvolving embedded comments

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
October 19, 2015 02:50
Subject:
Re: [perl #116639] regex optimiser wrongly rejects certain matchesinvolving embedded comments
Message ID:
20151019025016.GD18956@cancer.codesimply.com
* Karl Williamson <public@khwilliamson.com> [2015-10-18T00:16:44]
> Just to make sure everyone understands.
> 
> Currently (?#...) comments are allowed even when there is no /x.  We
> probably have to support that in the places where it's been that way all
> along, but we could decide to not support them in the places that I just
> added, when not under /x.  Thus, we could say that you can't split a
> quantifier from its atom except under /x.

Thanks, I was confused.

> I don't have an opinion on this.

I'm not strongly opinionated on this, but:  I think that I would find it useful
to say:

  If you want to put comments into a regular expression, you have two
  options.  You use /x and then insert space and any kind of comments between
  tokens, or you can skip /x and use (?#...) between tokens.

That is: always allow (?#...) in those places where space and comments become
allowed under /x.

-- 
rjbs

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About