[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: hexl-mode: searching for multi byte sequence?
From: |
Eli Zaretskii |
Subject: |
Re: hexl-mode: searching for multi byte sequence? |
Date: |
Tue, 14 Jul 2015 17:51:17 +0300 |
> From: "Stephen J. Turnbull" <address@hidden>
> Date: Tue, 14 Jul 2015 16:07:47 +0900
> Cc: address@hidden
>
> Alfred M. Szmidt writes:
> > Is there some way in hexl-mode to search for a (hex, octal, ...) byte
> > sequence? Currently, C-s behaves a bit strange in at least two regards:
> >
> > 1) If file contains the byte sequence #xDEADBEAF, depending on how
> > they are aligned (odd or even word), one has to look for "DEAD
> > BEAF" and "DE ADBE AF".
>
> C-u C-s de\(.\n\)*ad\(.\|\n\)*be\(.\|\n\)*af
>
> is what I'd use. It has obvious defects, and it would be nice if
> hexl-mode provided something a little less greedy (eg a transformation
> to a 3-armed disjunction allowing at most one newline plus handling
> the leading byte number after the newline).
Hexl already provides something similar, see
hexl-isearch-search-function. It allows to search in the text column
strings that span multiple lines, for example. It should be enhanced
to support Alfred's use case (and somebody please document it!).