In the syntax s/foo/bar \r and \n have different meanings, depending on context.
For foo:
\n = newline
\r = CR (carriage return = Ctrl-M = ^M)
For bar:
\r = is newline
\n = null byte (0x00).
I have seen questions on such stuff quite often in the past, and sometime in the future almost noone will know anything about this stuff eventually...
By 'popular' request:
Here is a list of the ASCII control characters, insert them in vim via CTRLvCTRL---key---.
In bash or the other unix/linux shells just type CTRL---key---. Try CTRLM in bash, its the same as hitting ENTER, as the shell realizes what is meant, even though linux systems use Line Feeds for line delimiting. Just the control char for Line Feed is CTRL-A, which is bound to 'jump to beginning of line' in bash.
To insert literal's in bash, CTRLv will also work.
Try in bash:
echo ^[[33;1mcolored.^[[0mnot colored.
This uses ANSI escape sequences, insert the two ^['s via CTRLvESC.
You might also try CTRLvCTRLmENTER, which will give you this:
bash: $'\r': command not found
Remember the \r from above? :>
The ASCII control characters list is different from the standard ascii symbol table, in that the control characters, which are inserted into a console/pseudoterminal/vim via the CTRL key (haha), can be found there.
Whereas in C and most other languages you usually use the octal codes to represent these 'characters'.
If you really want to know where all this comes from: http://www.linusakesson.net/programming/tty/.
This is the best link you will come across about this topic, but beware: There be dragons.
TL;DR
Usually foo = \n, and bar = \r.