in reply to Ah Crap

What, nobody will offer a single suggestion for how to fix such?

/['"]$a->{b} ['"]/x /['"]\Q$a->{b}\E['"]/ /['"]$a->{b}(?:)['"]/

I was surprised to find that the detection of the regex terminating delimiter depends on part of the parsing of the regex contents. I'm not sure I like that.

I was also surprised that my first attempt didn't work, since I thought this was supported for exactly this type of problem, despite the ambiguity it presents:

/['"]${a->{b}}['"]/

I'm curious if any of these surprises are because things have changed since some earlier version of Perl, but I don't have the time right now to find older versions to test against.

- tye        

Replies are listed 'Best First'.
Re^2: Regexes that look like dereferences but aren't
by duelafn (Parson) on Jul 23, 2010 at 13:52 UTC

    This works:

    /["']$${a{b}}["']/

    Good Day,
        Dean