Fix regex for windows
Also fix \r issue