I'm trying to match only when all space-separated words are longer than 3 word characters (3 word characters are mandatory, abc* is right but ab* is not). This is my test:
<html>
<body>
<script>
var re = /(?!(\W|^)\w{0,2}(\W|$)).*/i;
var texts = new Array("ab","ab*","abc de*", "ab* def");
for (textindex in texts)
{
var text = texts[textindex];
var matched = re.test(text);
document.write(matched + "<br/>")
}
</script>
</body>
</html>
All texts match, but I believe that none should match. Maybe I'm misunderstanding some fundamental on how lookahead works.