function validate1st8NotSame(value) if value:match("^(.)%1%1%1%1%1%1%1") then return false end return true end function validate1st8NoSame(value) if value:sub(1,8):match("(.).-%1") then return false end return true end print(validate1st8NotSame("aaaaaaaa")) --not valid print(validate1st8NotSame("aaaaaaab")) --valid print(validate1st8NotSame("aaaaaaa")) --!you should enforce 8+ charactesr otherwise this is valid print(validate1st8NoSame("abcdefghe")) --valid print(validate1st8NoSame("abcdefgae")) --invalid