title: Aptana Studio 3 - How can I change this command (regex replacement)
body: <p><em>What i want to do:</em></p>
  
  <p>edit the CSS command tidier to include a space/tab after the selctor: <code>#myid{...}</code> to be <code>#myid {...}</code> </p>
  
  <p><em>the file I want to edit:</em></p>
  
  <blockquote>
    <p>format_css_singleline.rb</p>
  </blockquote>
  
  <pre><code>command "Format CSS Single-line" do |cmd|
    cmd.key_binding = "M1+M2+F"
    cmd.output = :replace_selection
    cmd.input = :selection 
    cmd.scope = "source.css"
    cmd.invoke do |context|
      code = $stdin.read
      code.gsub!(/\n{3,}/im, "\n\n")
      code.gsub!(/[ \t]+/im, " ")
      code.gsub!(/(?m)([;:])\s+/im) {|match| "#{$1}" }  //i've tried adding a space after the {$1} here
      code.gsub!(/\s*}/im, "}")
      code.gsub!(/\s*{\s*/im, "{")
      code.gsub!(/[ \t]*,[ \t]*/im, ", ")
      code.gsub!(/@import(.*?);/im) {|match| "@import#{$1};\n\n" }
      code
    end
  end
  </code></pre>