in reply to regex to add network line-endings if required.
That's great! Now, what have you already tried?
Personally, I would attack the problem through the following two steps: