title: Java regex help
body: <p>A string must not include spaces or special characters. Only a-z, A-Z, 0-9, the underscore, and the period characters are allowed. </p>
  
  <p>How do I achieve this?</p>
  
  <p><strong>Update:</strong><br>
  All the solutions posted worked for me. </p>
  
  <p>Thanks everyone for helping out.</p>