[Regex]How to match a pstring ?

Hi all (and Kem …)

I would like to match a pstring in an hex string.
starts with the length of the string over 4 bytes “00 00 00 07” then the string itself “ABCDECT”
then forget any following chars until I get a \000

is it possible with regex (pretty sure yes but I don’t know how to do it !)


You can’t do that as it requires the regex engine to interpret the data and use it as a calculation in the remaining pattern, and regex doesn’t.