s/([13579bdf].)$/sprintf("%02x", hex($1) - 16)/ei;
Though, in practice, instead of using this obscure regexp, I would probably convert it into a bit vector and use vec to change the bit at position 31.
In reply to Re: Changing a bit in a string
by salva
in thread Changing a bit in a string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |