title: Regex to find comments starting with either ; or # characters
body: <p>I have ini files that have comments in the  but in one ini file the comments start with </p>
  
  <pre><code>; Enable the PHP scripting language engine under Apache.
  engine = On
  ; Enable compatibility mode with Zend Engine 1 (PHP 4.x)
  zend.ze1_compatibility_mode = Off
  ; Allow the &lt;? tag.  Otherwise, only &lt;?php and &lt;script&gt; tags are recognized.
  </code></pre>
  
  <p>and the other with </p>
  
  <pre><code># The default storage engine that will be used when create new tables when
  default-storage-engine=INNODB
  
  # The maximum amount of concurrent sessions the MySQL server will
  # allow. One of these connections will be reserved for a user with
  # SUPER privileges to allow the administrator to login even if the
  # connection limit has been reached.
  max_connections=255
  </code></pre>
  
  <p>currently find the beginning of the first using regex involves using </p>
  
  <pre><code>^(;).*$\n
  </code></pre>
  
  <p>I tried to modify this using</p>
  
  <pre><code>^[;#].*$\n 
  </code></pre>
  
  <p>to find either of the two comments but it did not work what would be the correct regex to find comments of either type?</p>
  
  <p>All of your suggestion where very helpful. The additional thing that I need to do was close the application and then reopen it to see the change take effect.</p>