title: HTML5 Regex Pattern for textbox validation: allow alphabet, spaces, and hyphens only
body: <p>I am creating a form in html and for my first and last name text inputs, I want to have a regex validation on them that only allows the user to input: letters of the alphabet, spaces, and hyphens.</p>
  
  <p>I have tried this pattern but to no avail:</p>
  
  <pre><code>[A-Za-z -]
  </code></pre>
  
  <p>My HTML code: </p>
  
  <pre><code>&lt;input type="text" id="first_name" name="first_name" maxlength="25" required="required" pattern="[A-Za-z -]"/&gt;
  </code></pre>
  
  <p>I know how to get only alphabet characters, but allowing spaces and hyphens only is something I'm unable to manage.</p>