Question: I'm trying to pull code comment blocks out of JavaScript files. I'm making a light code documentator.

An example would be:

```
/** @Method: setSize
 * @Description: setSize DESCRIPTION
 * @param: setSize PARAMETER
 */

```

I need to pull out the comments setup like this, ideally into an array.

I had gotten as far as this, but realize it may not handle new lines tabs, etc.:

```
\/\*\*(.*?)\*\/

```

(Okay, this seems like it would be simple, but I'm going in circles trying to get it to work.)

Answer: 
This should grab a comment block `\/\*\*[^/]+\/`. I don't think Regexp is the best way to generate an array from these blocks though. This regexp basically says:

Find a `/**` (the asterisk and forward slashes are escaped with `\`)

then find anything that isn't a `/`

then find one `/`

It's crude but is should generally work. Here's a live example <http://regexr.com?300c6>
What about some magic :)

```js
comment.replace(/@(\w+)\s*\:\s*(\S+)\s+(\w+)/gim, function (match, tag, name, descr) {
    console.log(arguments);
    // Do sth. ...
});

```

I've not tested this so for the regex there is no guarantee, just to point you to a possibility do some RegExp-search the John Resig way 8-)