title: PHP Regex and DocComment Value Parsing
body: <p>I am trying to parse the value a doc block comment</p>
  
  <pre><code>$str = "/**
   * @title View/List Permissions
   * @description Allow user to view list of permissions
   */";
  </code></pre>
  
  <p>The code that I am using is shown below:</p>
  
  <pre><code>$re = "/^.*@title\s+(\S*).*@description\s+(\S*).*$/s"; 
  preg_match($re, $str, $matches);
  </code></pre>
  
  <p>The current result is as follows:</p>
  
  <pre><code>[0] View/List
  [1] Allow
  </code></pre>
  
  <p><a href="https://regex101.com/r/dA7jW2/2" rel="nofollow">https://regex101.com/r/dA7jW2/2</a></p>
  
  <p>What can I do to get the the fill "View/List Permissions" and "Allow user to view list of permissions"?</p>
  
  <p>I have tried to modify the regex by replacing the \s+(\S*).* with \s+(\S.*) and while it works to some extent, it is adding the * from the next line</p>
  
  <p><a href="https://regex101.com/r/dA7jW2/3" rel="nofollow">https://regex101.com/r/dA7jW2/3</a></p>
  
  <p>Any ideas will  help..</p>
  
  <p>Thanks</p>