New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/(?{CODE})?/ #5712
Comments
From @AbigailCreated by @Abigail$ perl -wle '/(?{1})?/' results in Quantifier unexpected on zero-length expression in regex; While this is a useful (fatal) error for expressions without side-effects, The Perl regex machine is a nice framework to do backtracking with. And (?{ CODE })? There is a workaround of course: (?:(?{ CODE })|) but that's more verbose. Perl Info
|
From @tamiasOn Thu, Jul 11, 2002 at 09:50:28AM -0700, Abigail wrote:
But (?{ }) always succeeds. The only way for (?{ }) to be backtracked is Ronald |
From @vanstynAbigail <abigail@foad.org> wrote: Presumably the only relevant side-effects are the ones that occur under Do you have a more concrete example that cannot easily be expressed What would you want m/(?{1})*/ to do? The same as C< 1 while 1 >? :Flags: As far as I am aware we consciously chose to impose this restriction, Hugo |
From @AbigailOn Thu, Jul 11, 2002 at 01:10:27PM -0400, Ronald J Kimball wrote:
Well, yes. Consider the following code to generate all combinations "" =~ /(?{ @x = qw !A B C D!; @y = (0) x 4; }) I'd find it more logical to be able to write it as: "" =~ /(?{ @x = qw !A B C D!; @y = (0) x 4; }) |
From @AbigailOn Thu, Jul 11, 2002 at 06:28:02PM +0100, Hugo van der Sanden wrote:
Yes.
Well, as I said, there's a workaround, so it's always expressable in
Yes. Abigail |
From @vanstynAbigail <abigail@foad.org> wrote: Hence 'cannot _easily_ be expressed'. :> What would you want m/(?{1})*/ to do? The same as C< 1 while 1 >? I think this is in large part what the current behaviour aims to I could imagine supporting this in 5.10 by way of a new switch, but Hugo |
From @iabynremoving this ticket from the (?{}) metabug, as its a wishlist rather |
Migrated from rt.perl.org#10040 (status was 'open')
Searchable as RT10040$
The text was updated successfully, but these errors were encountered: