Fix regex to match Windows line endings

Fixes #5662