I was looking at a tutorial on Regex.

It was about how to get the class attribute from this piece of html

```
<pre class="ruby" name="code">

```

and the regex used was

```
<pre class="([^"]+)" name="code">

```

They recommended to use the above one instead of

```
<pre class="(.+)" name="code">

```

"as it goes beyond the quote."

I don't understand what they mean. It is just going to work anyway but then why the first regex is recommended. Am I missing anything? Please enlighten me.

Thanks in advance.