jQuery - Detecting specific length words in a string?
<p>In jQuery, is there a simpler method to detect if a string has words with X amount if characters or less? I'm about to write some Javascript that loops through each word in the string, checking each individual length, but want to know if there is a function, or a simpler method, possibly in jQuery, before I waste time and lines.</p>

<p>This is what I was going to do, there must be an easier method, possibly a one-liner?</p>

<pre><code>var bad_words = 0;
var search_str = $('#search_str').split(' ');
$.each(search_str, function(index, chunk) {
    if (chunk.length &lt; 4) {
        bad_words++;
    }
}
if (badwords &gt; 0) {
    alert("Words with 3 or less characters found.");
}
</code></pre>

<p>I'm not looking for somebody to do my work, I just want to know if it's possible, and if so, what should I be looking at.</p>
