title: swap values in sed when they match a regex
body: <p>I am trying to write a script to take all the php.js functions and create a node.js library for them, Which means I have to figure out how to convert</p>
  
  <p>this</p>
  
  <pre><code>function key (arr) {
  </code></pre>
  
  <p>to</p>
  
  <pre><code>key: function (arr) {
  </code></pre>
  
  <p>I know sed can do it, But I can't figure it out</p>
  
  <p>Thanks for any help</p>