in reply to Write to multiple files according to multiple regex
Thanks for the update.
Note: Your original regex would work as intended under the /m option. (It changes the meaning of '^' from 'start-of-string' to 'start-of-line'.)