![]() |
Reg Expr
Hi every body :
I want to search for a Hex Value using a RegExpr. Let me suppose i have : MyFile.exe that contains the following hex Value : ( 79797979797979795383EC44B823104000B9000000008A1880 C310881883C00183C10181F937D1000075EBA8F0F031F0A9 F0F0F0F07A0870B39E780873B1F173B0F171E9EF17F0F065 DBA8F00030F0ABB3B3B3B37908A8C5CA30F073B0F073B434 EFC0B34BB3D8F5F0F0F0D9FAF0F0F0A9C81731F0D95BA5 ) and in an other text file i store all my match patterns . ok then let me suppose this match pattern ( stored in this text file ): 5383EC44B823104000B9000000008A1880????A8 this means search for all Hex Values from 53 to A8 that gives me the Result : 5383EC44B823104000B9000000008A1880 C310881883C00183C10181F937D1000075EBA8F0F031F0A9 F0F0F0F07A0870B39E780873B1F173B0F171E9EF17F0F065 DBA8F00030F0ABB3B3B3B37908A8 Is there any way to do it . Thank you All |
Re: Reg Expr
am i stupid or is there no question?! :gruebel:
|
Re: Reg Expr
Hi,
you can do this task with Pos and Copy, too. You do not need a reg expr for that. |
Re: Reg Expr
Zitat:
Sorry Again . :oops: |
Re: Reg Expr
Zitat:
|
Re: Reg Expr
Zitat:
|
Re: Reg Expr
Delphi-Quellcode:
procedure GetHexValues(Input:string; Values:TStrings);
var RegExpr:TRegExpr; begin RegExpr:=TRegExpr.Create; try Values.Clear; RegExpr.Expression := '[^A-F0-9]*([A-F0-9]*)[^A-F0-9]*'; if RegExpr.Exec(Input) then begin repeat Values.Append(RegExpr.Match[1]); until not RegExpr.ExecNext; end; finally RegExpr.free; end; end; ![]() |
Re: Reg Expr
Zitat:
|
Re: Reg Expr
Zitat:
|
Re: Reg Expr
Zitat:
greedy-mode? yes that will be work. another way is RegExpr.ModifierG. see the help-file for RegExpr-Component. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:59 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz