title: Javascript regex to match JSDoc tags inside a documentation block
body: <p>So right now I can isolate each JSDoc (ish) block I have in my code, for example I have this block here</p>
  <pre><code>/// @tag {type} name description
  /// description continue
  /// another description line
  /// @tag {type} name description
  /// description continue
  /// @tag name description just one line.
  /// @tag {type} name
  </code></pre>
  <p>I want to use a Regex expression to match each tag inside the block a tag needs to have a <code>@name</code> format then it can have a type <code>{type}</code> (optional) then it requires a <code>name</code> and finally it can have a description.. the description can be both multiple lined or single lined (and is also optional). So</p>
  <p>the Regex I have came up with was:</p>
  <p><code>^\/{3} @(?&lt;tag&gt;\w+)(?:[ \t]+{(?&lt;type&gt;.*)})?(?:[ \t]+(?&lt;name&gt;\w+))(?:[ \t]+(?&lt;desc&gt;[\s\S]*))?</code></p>
  <p>my problem is with the description as soon as I hit the description it doesn't stop at the start of the next tag... I get the feeling that right now I'm using a greedy approach but I cannot find a wait to make it non greedy.</p>
  <p>So the example above matches:</p>
  <p><strong>tag</strong>: <code>tag</code></p>
  <p><strong>name</strong>: <code>name</code></p>
  <p><strong>description</strong>:</p>
  <pre><code>description
  /// description continue
  /// another description line
  /// @tag {type} name description
  /// description continue
  /// @tag name description just one line.
  /// @tag {type} name
  </code></pre>
  <p>I wanted the description to stop just as the new tag starts or if the block ends</p>