【问题标题】:How to do hexadecimal regex search如何进行十六进制正则表达式搜索
【发布时间】:2021-05-29 09:49:14
【问题描述】:

不确定如何使用正则表达式在十六进制编辑器中查找某个十六进制字符串之后的所有匹配项:我目前正在使用的十六进制 writer = 010 编辑器的示例。 正在查询:0201010420

在十六进制编辑器中打开C盘:

02 01 01 04 20 (32 extra bytes any)

例子:

**02 01 01 04 20** 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
'''

^^^ -> CTRL + F -> regular expression > ????
How do I use regex to search for that occurrence of 02 01 01 04 20 and to grab the next 64 or more specifically say (32 bytes) and to find all occurrences of that. I want to do this to copy it to a text editor for use.


【问题讨论】:

    标签: regex hex notepad++


    【解决方案1】:

    我通过在十六进制字节之前放置'\x'前缀来使用正则表达式(无论是在文本模式还是十六进制模式下)。

    我在手册页上找到了一些描述:

    Matching Hex Bytes
    
    When searching for hex bytes use the syntax '\xHH' to denote a hex byte where HH is the byte to find. 
    This syntax must be used for regular expressions even when the Find type is set to Hex Bytes in the Find Bar. 
    
    For example, to search for the bytes '3F 4D ?? 0F' use the regular expression:
    
        \x3F\x4D.\x0F
    

    小心那个'.'代表一个字节(不是一个字符)。

    更多详情请参考这里的链接010editor-manual-RegularExpressions

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-25
      • 1970-01-01
      • 2021-06-04
      • 2014-03-05
      • 2011-10-03
      • 1970-01-01
      • 2017-02-27
      相关资源
      最近更新 更多