in reply to regex and printing

Can you please provide a small sample of both files, and some code that you've tried that doesn't seem to be working?

Each sample should go within <code></code> tags as should the script, so that they are easily identified and copyable for those who can test for you.