Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Re: Re: Re: Re: What's like $+ but not gives the ordinal?

by japhy (Canon)
on Jun 28, 2001 at 19:05 UTC ( [id://92306]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Re: What's like $+ but not gives the ordinal?
in thread What's like $+ but not gives the ordinal?

Ah, I must have misread that as "sucessful subgroups were in the last match". Nevermind, then. The docs have this to say about @-:
@- [snip] with `substr $_, $-[$#-], $+[$#-]'. One can use `$#-' to find the last matched subgroup in the last successful match. Contrast with `$#+', the number of subgroups in the regular expression. Compare with `@+'. [snip]


japhy -- Perl and Regex Hacker

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: What's like $+ but not gives the ordinal?
by John M. Dlugosz (Monsignor) on Jun 28, 2001 at 19:32 UTC
    Mine says “You can use $#- to determine how many subgroups were in the last successful match. Compare with the @+ variable.” which is basically the same as @+ and not at all what yours says. Yours matches what I'm seeing in the code.

    Perhaps the doc change didn't make it into the Release version when the code did, or ActiveState goofed in doing patches?

    —John

      Data points: my ActivePerl build 616 has japhy's wording as does my Indigo Perl 5.6.0 (and I recall this difference in the first Perl 5.6 that I installed which was probably ActivePerl build <616).

              - tye (but my friends call me "Tye")
        Curiouser and curiouser! Mine is ActiveState Perl build 626 (Perl 6.5.1 with 1 registered patch), which is newer.

        —John

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-26 02:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found