#我自己写的很烂了,这里是收藏来自大佬的解答,正则表达式还是不太熟悉啊
`import` `re`
`try``:`
`while` `1``:`
`s` `=` `raw_input``()`
`a` `=` `re.findall(r``'(.{3,}).*\1'``, s)`
`b1` `=` `re.findall(r``'\d'``, s)`
`b2` `=` `re.findall(r``'[A-Z]'``, s)`
`b3` `=` `re.findall(r``'[a-z]'``, s)`
`b4` `=` `re.findall(r``'[^0-9A-Za-z]'``, s)`
`print` `'OK'` `if` `([b1, b2, b3, b4].count([]) <``=` `1` `and` `a` `=``=` `[]` `and` `len``(s) >` `8``)` `else` `'NG'`
`except``:`
`pass`
网友评论