title: Perl Regex Multiple Capture Groups
body: <p>I am never going to say I am an expert at regex and I am having an issue with this one I am sure due to my lack of understanding. If someone could please try and explain to me how to handle this situation I would really appreciate it. </p>
  
  <pre><code>string = "hello.world with_args, and_more_args #plus a comment
  </code></pre>
  
  <p><strong>Regular Expression</strong></p>
  
  <pre><code>/^\w*\.(\w+)\s+(.*?)([^#]*)$/
  </code></pre>
  
  <p><strong>Groups</strong></p>
  
  <pre><code>1. world
  2. with_args, and_more_args #
  3. plus a comment
  </code></pre>
  
  <p>The output I am hoping for is </p>
  
  <pre><code>1.world
  2.with_args, and_more_args
  3.#plus a comment
  </code></pre>
  
  <p>Any suggestions would be greatly appreciated and if you could teach me something along the way i certainly won't complain.</p>