in reply to Regex backreference
You need to enter capture groups into your $expression, otherwise $1, $2, etc will be undef. For example, if you enter (\w\w\w) instead of \w\w\w, your program prints $1 is sil.