title: How to delete all single-line PHP comment lines through Regex in any editor
body: <p>I have a PHP file open in editor like <a href="https://en.wikipedia.org/wiki/Geany" rel="nofollow noreferrer">Geany</a>/<a href="https://en.wikipedia.org/wiki/Notepad%2B%2B" rel="nofollow noreferrer">Notepad++</a> which has both type of comments single-line and block-comments.</p>
  <p>Now as block-comments are useful for documentation, I only want to remove single-line comments starting with <code>//~</code> or <code>#</code>. Other comments starting with <code>//</code> should remain if they are not starting line from <code>//</code>.</p>
  <p>How can I do that with a regular expression? I tried this one below, but I get stuck up in escaping slash and also including <code>#</code>.</p>
  <pre><code>^[#][\/]{2}[~].*
  </code></pre>