in reply to Re^5: How we can separate a backref from a digit?
in thread How we can separate a backref from a digit?

I still think it's /...(?:\1).../.

$ perl -Mre=debug -E'qr/(a) \1 1/x' Compiling REx "(a) \1 1" Final program: 1: OPEN1 (3) 3: EXACT <a> (5) 5: CLOSE1 (7) 7: REF1 (9) 9: EXACT <1> (11) 11: END (0) anchored "a" at 0 floating "1" at 1..2147483647 (checking floating) mi +nlen 2 Freeing REx: "(a) \1 1" $ perl -Mre=debug -E'qr/(a)(?:\1)1/' Compiling REx "(a)(?:\1)1" Final program: 1: OPEN1 (3) 3: EXACT <a> (5) 5: CLOSE1 (7) 7: REF1 (9) 9: EXACT <1> (11) 11: END (0) anchored "a" at 0 floating "1" at 1..2147483647 (checking floating) mi +nlen 2 Freeing REx: "(a)(?:\1)1"

Update: Me tired. Grammar bad. Fixed.

Replies are listed 'Best First'.
Re^7: How we can separate a backref from a digit?
by BrowserUk (Patriarch) on Mar 19, 2011 at 00:10 UTC
    In math and Perl, when one wants to group operators,

    But you aren't "grouping operators". You're wrapping a single operator in grouping parens in order to isolate it from the next operator.

    On the basis that using grouping parens to group a single operator is more confusing than using the character class escaping mechanism which has many benefits in this role, and is therefore a good thing to promote, I prefer the latter. But I wouldn't try and impose that on anyone else.

    That you will disagree with me will come as no surprise to anyone.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      Sorry, which brackets do you call confusing, the ones around the /\1/ or the one around the /1/?

      I don't agree that

      (4+5)*6

      and

      (ln x) + y

      are confusing.

        I don't agree that (4+5)*6 and (ln x) + y are confusing.

        I didn't suggest either of those, nor anything remotely relating to them, was confusing. You've just plucked those out of thin air.

        Once again, as is your normal practice when you've said something even you realise doesn't hold water, you attempt to distract from it by arguing something completely and utterly unrelated & irrelevant. Guess what, I'm not going to play.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.