> But if I try to match the extra digits at the end like this:
>
>>pchars = re.compile('\x00\x00\x00\x\d+')
>
> I get an error:
>
>>ValueError: invalid \x escape

You should just be able to say:

    pchars = re.compile('\x00\x00\x00..')

because it looks like you're trying to grab at the last two characters.

Hexadecimal escape is just another notation for expressing a character.

So, for example, take a look at this string.

    '\x68\x69\x20\x69\x61\x6e'

Try printing it.


Hope this helps.
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to