s/(.)(?=.)/$2$1/g;
...
... produced 5 warnings and left the string unchanged (I presume the warnings were that $2 was undef)..
Yes, because there is no capture group 2 ((?=.) is a non-capturing look-ahead) and the first capture group is being replaced with itself: $1.
In reply to Re: rotate a vector with a regex?
by AnomalousMonk
in thread rotate a vector with a regex?
by misterperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |