$ perl -Mre=debug -e'/[^01]/, /^[01]+$/' Freeing REx: `","' Compiling REx `[^01]' size 12 Got 100 bytes for offset annotations. first at 1 1: ANYOF[\0-/2-\377{unicode_all}](12) 12: END(0) stclass `ANYOF[\0-/2-\377{unicode_all}]' minlen 1 Offsets: [12] 1[5] 0[0] 0[0] 0[0] 0[0] 0[0] 0[0] 0[0] 0[0] 0[0] 0[0] 6[0] Compiling REx `^[01]+$' size 15 Got 124 bytes for offset annotations. first at 2 synthetic stclass `ANYOF[01]'. 1: BOL(2) 2: PLUS(14) 3: ANYOF[01](0) 14: EOL(15) 15: END(0) floating `'$ at 1..2147483647 (checking floating) stclass `ANYOF[01]' anchored(BOL) minlen 1 Offsets: [15] 1[1] 6[4] 2[4] 0[0] 0[0] 0[0] 0[0] 0[0] 0[0] 0[0] 0[0] 0[0] 0[0] 7[1] 8[0] Freeing REx: `"[^01]"' Freeing REx: `"^[01]+$"'