-null- Posted March 7, 2009 Share Posted March 7, 2009 I'm trying to extract some data from a hex file. The data I want is prefixed by a series of hex characters then a country name a couple more hex characters then a user name. I've attached a screen grab showing the data I'm extracting from. There can be multiple sections in the file like this, with different countries (from a preset list) and user names. And I'd like to extract all the countries and their associated user names. I have a regular expression that I believe should work and does so in Editpad Pro however it doesn't in PHP. This is my regex code preg_match_all('/\x00\x0E[\x07|\x06]\x00(a\x00u\x00s\x00t\x00r\x00i\x00a|b\x00r\x00i\x00t\x00a\x00i\x00n|f\x00r\x00a\x00n\x00c\x00e)\x00\x0E(.*?)\x00\x0E/Us',$data,$matches); [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/148399-extract-data-from-hex-file/ Share on other sites More sharing options...
-null- Posted March 9, 2009 Author Share Posted March 9, 2009 Never mind, I solved it. The problem was with the contents of the file, not the regular expression. Quote Link to comment https://forums.phpfreaks.com/topic/148399-extract-data-from-hex-file/#findComment-780270 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.