Python 正则表达式验证二进制数字

来源:互联网 发布:如何在淘宝开药店 编辑:程序博客网 时间:2024/05/30 23:19
1. Find a binary number in a larger body of test\b[01]+\b2. Check whether a text string holds just a binary number\A[01]+\Z3. Find a binary number with a 0b prefix\b0b[01]+\b4. Find a binary number with a B suffix\b[01]+B\b5. Find a binary byte value or 8-bit number\b[01]{8}\b6. Find a binary word value of 16-bit number\b[01]{16}\b7. Find a string of bytes (i.e. a multiple of eight bits)\b(?:[01]{8})+\b

0 0