Thanks, this looks interesting and I can definitley learn from it.
I'm not certain it wil work in this particular application, as there will be many hex adresses in my file and I only want to pull certain ones, eg. xyz and xy2 but not any others. The ones I want will be added to the array.
I think I have a solution, and if it works I'll share it here, but I found it wasn't working because some of my "xyz" strings have square brackets in them and need to be escaped in the regexp expression, but not in the fprintf :/