Revert "Replace newline with OS specific EOL"

This reverts commit 66ee3145c6562bef4f88eed9008b93d586f9da13.
Revert "Use OS specific EOL instead of RegExp"

This reverts commit 79ea977e92552f2dbfd6441dc5f3ed7431063a99.
Using carriage return and newline to detect newline in REGEXES since any system can have any type of file