[BUGFIX] Clean up and fix the backslash usage in strings

* use the constants CR, LF, CRLF and TAB whereever possible
* always use single quotes when defining regular expressions
* always escape backslashes in strings (unless the backslash is used
  to escape a backslash or a single quote)

Change-Id: I759f9e17f624426ee7753fabe12ef120e4ed206a
Resolves: #58222
Releases: 6.2
Reviewed-on: https://review.typo3.org/29673
Reviewed-by: Nico de Haen
Tested-by: Nico de Haen