in reply to Pattern matching: Why no \1 in [ ]?
from this you can see that the \1 is being interpretted as a unicode 1 to check you can:perl -Mre=debug -le 'print /(.)[^\1]\1/ ? "match" : "no match"' Freeing REx: `","' Compiling REx `(.)[^\1]\1' size 19 Got 156 bytes for offset annotations. first at 3 1: OPEN1(3) 3: REG_ANY(4) 4: CLOSE1(6) 6: ANYOF[\0\2-\377{unicode_all}](17) 17: REF1(19) 19: END(0)
and you'll see that that is a "no match"perl -le '$_ = "B\1B"; print /(.)[^\1]\1/ ? "match" : "no match"'
|
|---|