Build regular expression with hex characters
Posted: Wed Mar 18, 2009 5:38 am
I'm using regular expressions to find data in a hex file. To find a certain set of data I need to append the hex characters 81 and 17 to the regular expression that I have built to ensure it is the correct data I find. When I try and do this however the expression stops matching.
$map_name is a variable containing a value from a database that I want to check for. Without the hex characters in the preg_match this does match the data but with them nothing is found.
Is this something to do with how I am noting the hex characters.
Code: Select all
preg_match('/' . $map_name . '\x00\x81\x17/Uis', $data)Is this something to do with how I am noting the hex characters.