Perl-Sensitive Sunglasses | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Thanks for the additional paragraphs. The OP's supposition implied that variables could be used there. They can't. That's what I said. That's not how I read I would assume that quantifier cannot be a '\x' variableat all—it seems to me specifically to be saying that you can't use a variable there. Do you mean that, since it mentions that you can't use one sort of variable, it implies that you can use others? Aside from that, did you forget about capture buffers, the return value of the last (?{ }) and Perl variables? There's just no way to access them there. You certainly can use, at least in the sense of referring to, capture buffers (which I guess means $1 instead of \1?) and Perl variables, like /(.{$1}){$a}/; since their values don't change during the regex match *, the result is the same (as you pointed out) as substituting in their values before running the regex. (Indeed, I think that's exactly what happens internally.) This is just what I meant in Re: Regex fun; so, as I indicated there, I must (still) be misunderstanding you. UPDATE: To avoid the appearance of slyly avoiding the bit about the return value of the last (?{ }), I didn't forget about it, but only because I never knew about it. Thanks! Another UPDATE: * Ah, this is probably a crucial point! I always assumed that $1 didn't change until the match had completed; but I guess it's more accurate to say that it does change, but that all the interpolation has already happened at that point, so that change is not reflected in the regex. There's my misunderstanding; sorry! In reply to Re^6: Regex fun
by JadeNB
|
|