does anyone know if backrefs are supposed to work within the {} quantifier, or not?
Good question.
My guess would be that they're not supposed to work -- text matched in a backreference is matched textually, without metacharacters. So doing /^(.)\1$/ won't match a wildcard as a second character if the first is a literal ".", and won't match one or more "+" if the first character is a literal "+".
Keeping to that pattern, it makes sense that if a backreference appears between {}, what's parsed is a literal "{", the backreference, and a literal "}".
It would obviously complicate regexen something fierce if the possibility of recompiling the regex based on backreferences had to be handled in the general case, and not just in the ??{} case.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.