title: Replace occurrences swift regex
body: <p>I'm trying to use the <code>String.replacingOccurrences</code> to change all occurrences of the following characters into commas:</p>
  
  <p><code>#.$[]</code></p>
  
  <p>However I can't seem to get it to accomplish this with what I have:</p>
  
  <pre><code>func cleanStr(str: String) -&gt; String {
      return str.replacingOccurrences(of: "[.#$[/]]", with: ",", options: [.regularExpression])
  }
  
  print(cleanStr(str: "me[ow@gmai#l.co$m"))   // prints "me[ow@gmai,l,co,m\n"
  </code></pre>
  
  <p>Can anybody help me see what I'm doing wrong?</p>