title: Perl regex match optional whitespace characters
body: <p>I'm trying to parse/extract data from an XML file and retrieve necessary data.</p>
  
  <p>For example:</p>
  
  <pre><code>&lt;about&gt;
      This is an XML file
      that I want to
      extract data from
  &lt;/about&gt;
  &lt;message&gt;Hello, this is a message.&lt;/message&gt;
  &lt;this&gt;Blah&lt;/this&gt;
  &lt;that&gt;Blahh&lt;/that&gt;
  &lt;person&gt; 
      &lt;name&gt;Jack&lt;/name&gt;
      &lt;age&gt;27&lt;/name&gt;
      &lt;email&gt;jack@gmail.com&lt;/email&gt;
  &lt;/person&gt;
  </code></pre>
  
  <p>I'm having trouble getting the content within the <code>&lt;about&gt;</code> tags.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>(&lt;\w*&gt;)[\s*]?([\s*]?.*)(&lt;\/\w*&gt;)/m
  </code></pre>
  
  <p>I'm simply trying to extract the tag name and content, which is why I have the parentheses there.  i.e. <code>($tag = $1) =~ s/[&lt;&gt;]//</code>  to get the tag name, <code>$tagcontent = $2</code>  to get the tag's contents.  I'm using <code>\s</code> for the white-space characters (<em>space, tab, newline</em>) and the <code>?</code> because it may or may not occur <code>*</code> amount of times.</p>
  
  <p>I was testing this through <a href="http://www.regexe.com/" rel="nofollow">http://www.regexe.com/</a>, and no luck with the matching.</p>
  
  <p>Any help is appreciated.  Thanks in advance!</p>