Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Global match and capture group in look-ahead == under-populated "@-"?

by Anonymous Monk
on Nov 20, 2022 at 10:08 UTC ( [id://11148267]=note: print w/replies, xml ) Need Help??


in reply to Re: Global match and capture group in look-ahead == under-populated "@-"?
in thread Global match and capture group in look-ahead == under-populated "@-"?

It was golfing exercise, where I tried everything possible presumably correct from language spec POV as I see it, be it sketchy or not. In the end I didn't need @-, so no problem at all, thank you, just curiosity. Perhaps I know less about regular expressions than I thought.

Consistent behaviour would be $#- and $#+ both the same and either 0 or 2 here. And all three $1, $+, $^N ending up the same here, also. It's not what I observe.

Can you explain debug output, why the

Matching REx "(?=(a))" against "a"

and then

SUCCEED: subpattern success...

are mentioned twice?

Same with perl -MRegexp::Debugger -e '$_="a";s/(?=(a))/b/g', I hit Enter too many times, why are steps 0..7 repeated twice?

Replies are listed 'Best First'.
Re^3: Global match and capture group in look-ahead == under-populated "@-"?
by Anonymous Monk on Nov 20, 2022 at 10:19 UTC
    $#- and $#+ both the same and either 0 or 2

    please read "either -1 or 1"

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-26 06:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found