http://qs321.pair.com?node_id=1205869


in reply to script running on linux but not windows

Your first line of code probably needs to change. It specifies a path to a file. The file is likely going to be in a different location anyway. You'd be better off using single quotes for that line.

You should not change the slashes in the remaining 3 lines of code because they delimit regular expressions.

but does not run on windows
You should be able to start to debug where things go wrong. Then you can narrow down your problem and post other, more specific questions: Basic debugging checklist