Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Only sometimes deprecated? "Unescaped left brace in regex is deprecated"

by LanX (Saint)
on Jun 02, 2017 at 16:22 UTC ( [id://1191984]=note: print w/replies, xml ) Need Help??


in reply to Re: Only sometimes deprecated? "Unescaped left brace in regex is deprecated"
in thread Only sometimes deprecated? "Unescaped left brace in regex is deprecated"

Thanks! :)

hmm, the perldelta doesn't talk about quantifiers, and the ambiguity would already have existed before.

I thought it's deprecated to facilitate parsing extended syntax like /abc(?{print "Hi Mom!";})def/

see perlretut for other examples

so I'm not sure if it's about quantifiers...

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

  • Comment on Re^2: Only sometimes deprecated? "Unescaped left brace in regex is deprecated"
  • Download Code

Replies are listed 'Best First'.
Re^3: Only sometimes deprecated? "Unescaped left brace in regex is deprecated"
by Eily (Monsignor) on Jun 02, 2017 at 16:37 UTC

    Because (? is invalid syntax on its own, in any (?X pattern the X is unambiguously special or incorrect, but never litteral. perlre however does talk about extending the quantifier syntax.

    like making the lower bound of a quantifier optional
    And any new syntax that's not a modifier can be added with a (?X pattern. That's why I concluded that disallowing unescaped litteral { was probably an opening toward new quantifier syntax (because { only introduces quantifiers). I thought of something like /.{{!($_ % 3)}}/ instead of /(?:.{3})*/ (it's harder to read though ...), or even "3ABCD" =~ /(\d)(.{{$1}})(.*)/; #(3,"ABC", "D"). But that's wild guesswork

    PS: How do you like all those unbalanced left tokens? ^^"

      Thanks, in hindsight all these explanations and reasonings make sense.

      I just expect documentation to be clearer.

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)
      Je suis Charlie!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1191984]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-20 02:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found