On Sun, Feb 27, 2011 at 2:32 PM, rob stanton <tnotnats / gmail.com> wrote:
> Hi Robert, got it now, but the data is all in hex, your code gives the
> ascii code ? but its almost there. the name follows 10 00 10 00 in this
> format 50 4e (P) (N) then xx 00 "surname" 5e "first name" followed by 10
> and then 00
> I'll see what I can do with your code but any help would be appreciated
>
Well if in your encoding letters do not match \w, you will need to
indicate the values with hex values in the regex. This is a little
more work but there should not be any difficulty.

you can match the hex value 4e against /\x4e/
a range of hex values with  /[\x20-\x32]/
or in the worst case you enumerate the characters that shall match
with /[\x32,\x36,\x42...]/

assuming that your letters are encoded with the characters 0x40, 0x42
and 0x44 to 0x50
the expression

content.scan( /\n\0\n\0([\x40,\x42,\x44-\x50]+)/ )

would do the trick.

HTH
R.
> --
> Posted via http://www.ruby-forum.com/.
>
>



-- 
The 1,000,000th fibonacci number contains '42' 2039 times; that is
almost 30 occurrences more than expected (208988 digits).
N.B. The 42nd fibonacci number does not contain '1000000' that is
almost the expected 3.0e-06 times.