zoukankan      html  css  js  c++  java
  • python正则表达式匹配十六进制数据

    1. Find any hexadecimal number in a larger body of text  

    [0-9a-fA-F]+  

    2. Check whether a text string holds just a hexadecimal number  

    A[0-9a-fA-F]+  

    3. Find a hexadecimal number with a 0x prefix  

    0x[0-9a-fA-F]+  

    4. Find a hexadecimal number with an &H prefix  

    &H[0-9a-fA-F]+  

    5. Find a hexadecimal number with an H suffix  

    [0-9a-fA-F]+H  

    6. Find a hexadecimal byte value or 8-bit number  

    [0-9a-fA-F]{2}  

    7. Find a hexadecimal word value or 16-bit number  

    [0-9a-fA-F]{4}  

    8. Find a hexadecimal double word value or 32-bit number  

    [0-9a-fA-F]{8}  

    9. Find a hexadecimal quad word value or 64-bit number  

    [0-9a-fA-F]{16}  

    10. Find a string of hexadecimal bytes (i.e., an even number of hexadecimal digits)  

    (?:[0-9a-fA-F]{2})+  

    11. Find any hexadecimal number standalone in a larger body of text  

    (?:^|(?<=s))[0-9a-fA-F]+(?=$|s) 

     

    [bibliography]

    http://blog.csdn.net/guaguastd/article/details/38920565

     

     

  • 相关阅读:
    11.13 同步异步协程
    GIL及进程池
    线程
    守护进程-互斥锁-IPC
    进程
    网络编程
    异常的处理
    面向对象编程2
    第一章 python学习,个人对计算机硬件的一些理解
    ActiveReports之直接打印报表
  • 原文地址:https://www.cnblogs.com/CarbinHee/p/7712555.html
Copyright © 2011-2022 走看看