[eluser]Pygon[/eluser]
Might want to note that:
Code:
@card_masked = card_masked.sub(/^([0-9]+)([0-9]{4})$/) { '*' * $1.length + $2 }
Doesn't create "xxxx-xxxx-xxxx-1234" either. Like my function, it creates "************1234" and expects the input to be only numbers. Don't know if you noticed that coolfactor.