[yunqa.de] Re: using DIRegEx

  • From: "randy domerk" <randydom@xxxxxxxxx>
  • To: yunqa@xxxxxxxxxxxxx
  • Date: Thu, 20 Nov 2008 02:28:32 +0100

Yes that works very well so what i did is converting my Hex values into the
DIRegEx patterns :

for example to look for  4d5a50 ( MZP )

i did :

 \x4d\x5a\x50

but how to look for :

4d??50  ( i did  \x4d\x??\50 but this gives  MP )

or  4d*50 ( i did  \x4d\x*\50 this also  gives  MP ).


many thanks again .


2008/4/29 Delphi Inspiration <delphi@xxxxxxxx>

> randy domerk wrote:
>
> >second what i want is :
> >like in your : DIRegEx\Demo\DIRegEx_SearchStream    . but instead of
> looking for a String in a Stream i want to search for an Hex Value
>
> You can include binary into a DIRegEx pattern, but you have to convert it
> into a form which DIRegEx understands. This is the binary encoding for
> DIRegEx patterns:
>
>  \xhh
>
> where the two hh represent your hex value. There are other forms as well,
> all listed at the DIRegEx help, Quick Syntax Reference, Characters section.
>
> So all you have to do is to convert your hex value
>
>  12ab34
>
> into
>
>  \x12\xab\34
>
> and enter it into the DIRegEx_SearchStream pattern edit. Of coures you
> would like to do the conversion in code. This is out of the scope of
> DIRegEx, but really simple to do with Delphi's IntToHex function and a
> little string concatenation.
>
> Ralf
>
> _______________________________________________
> Delphi Inspiration mailing list
> yunqa@xxxxxxxxxxxxx
> //www.freelists.org/list/yunqa
>
>
>
>


-- 
Yours Randy .

Other related posts: