title: JavaScript REGEX pattern matching
body: <p>I am completely new to JS, and having trouble figuring out how to validate that the <em>input
  via prompt</em> <strong>CONTAINS</strong> three or more words, seperated by spaces, only alphabetical characters.</p>
  
  <p>This is what I have: </p>
  
  <pre><code>var p = prompt("Enter a phrase:", "");
  var phr = p.search(/^[^0-9][2,3]$/);
  
    if(phr != 0)
  {
     alert("invalid");return
  }
  else{document.write("phr");
  </code></pre>