in reply to Help with regex
Have you used the debugger on this script, and really looked at what each each $line looks like?
throop