Regex not finding hits

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
JimmyW
Posts: 11
Joined: Sat Oct 01, 2005 9:52 pm

Regex not finding hits

Post by JimmyW »

I'm trying to test a few regexes, so I started out simply by trying to find some hex strings in an open file, in hex view. I'm new at TextPad, so perhaps I'm proceeding incorrectly. My file has the following hex string:
00 00 00 00 00 EA 65 12 45 00

The regex \x12\x45\x00 finds 0x124500
The regex \xEA\x65 finds nothing
The regex \x45 finds both 0x45 and 0x65

What am I doing wrong? Thanks.
User avatar
s_reynisson
Posts: 940
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

I would tick "Hex" under Conditions when using binary view. That way you don't need to use a regex and you can just enter "124500" in your first example. I'm also struggling with the \x format when in binary view having ticked "Text" under Conditions. Perhaps using "text" in binary view makes no sence? Just my 0.02usd. HTH
Then I open up and see
the person fumbling here is me
a different way to be
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

To add to this...

The reason why the regex \x45 matches both 0x45 and 0x65 is that they are upper- and lower-case 'E', respectively. Try selecting Match case.

And there does seem to be a bug associated with regexes containing lower-case letters represented in hex (e.g., \x65) when Match case is not selected, in both text and binary view. They don't seem to match anything.
Post Reply