title: How do I match "|" in a regular expression in PowerShell?
body: <p>I want to use a regular expression to filter out if a string contains one of "&amp;" or "|" or "=". I tried:</p>
  
  <pre><code>$compareRegex = [String]::Join("|", @("&amp;","|", "="));
  "mydfa" -match $compareStr
  </code></pre>
  
  <p>PowerShell prints "True". This is not what I wanted, and it seems "|" itself has confused PowerShell for a matching. How do I fix it?</p>