title: Xcode regular expression replace for replace "<any number of whitespace>];"
body: <p>I'm looking for a regex replace within Xcode that allows me to remove all whitespace &amp; newlines before <code>];</code></p>
  
  <p>I have to admit I'm at odds with regex. I got as far as <code>\S(\s+)];</code> … but Xcode doesn't seem to find any occurances where the <code>];</code> is on a new line.</p>
  
  <p>Here's two examples of what I want to fix:</p>
  
  <pre><code>[self methodWithBlock:^(){
  } ];
  
  [self methodWithBlock:^(){
  } 
  
            ];
  </code></pre>
  
  <p>To this:</p>
  
  <pre><code>[self methodWithBlock:^(){
  }];
  </code></pre>
  
  <p>Those badly formatted blocks were a result of learning uncrustify. ;)</p>