With regex, how do I replace each newline char (\n) with a comma (,)?

Like this:

Demetrius Navarro
Tony Plana
Samuel L. Jackson

To:

Demetrius Navarro,Tony Plana,Samuel L. Jackson

Not in a particular programming lang, just standard regex. Something like this:

(.*)
$1
//This just takes the whole string and outputs it as is, I think
Edit
Report