What is the reqular expression for RFC4716 SSH2 public key <p>I need to restore the RFC4716 SSH2 public key structure after having replaced all new line characters with spaces (the key contents is passed as a parameter to the program and retrieved as $@ in bash). I would like to use regular expression and sed program to do it. Has anyone come across a solution?</p> <p>Example:</p> <ul> <li><p>input string passed to the program (one string all new lines replaced by spaces):</p> <p><code>---- BEGIN SSH2 PUBLIC KEY ---- Comment: "1024-bit RSA, converted from OpenSSH by me@example.com" x-command: /home/me/bin/lock-in-guest.sh AAAAB3NzaC1y(... some spaces are inserted instead of LF)9zcE= ---- END SSH2 PUBLIC KEY ----</code></p></li> <li><p>output string:</p> <p><code>---- BEGIN SSH2 PUBLIC KEY ---- Comment: "1024-bit RSA, converted from OpenSSH by me@example.com" x-command: /home/me/bin/lock-in-guest.sh AAAAB3NzaC1yc2EAAAABIwAAAIEA1on8gxCGJJWSRT4uOrR13mUaUk0hRf4RzxSZ1zRb YYFw8pfGesIFoEuVth4HKyF8k1y4mRUnYHP1XNMNMJl1JcEArC2asV8sHf6zSPVffozZ 5TT4SfsUu/iKy9lUcCfXzwre4WWZSXXcPff+EHtWshahu3WzBdnGxm5Xoi89zcE= ---- END SSH2 PUBLIC KEY ----</code></p></li> </ul>