Just because it's not a very useful thing to do, doesn't mean it's not a bug. $1, etc., shouldn't be affected by unsuccessful matches. This is clearly spelled out in $& (which suffers the same bug as $1) even if $<_digits_> is for some reason missing the "successful" qualification.
In reply to Re: Bug or feature? s/// and the g option
by ysth
in thread Bug or feature? s/// and the g option
by Belgarion
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |