Regular Expressions

Solutions

Regexp Solutions

<!DOCTYPE html>
<html>
  <head>
    <title>Regular Expressions</title>
    <meta charset="utf-8">
  </head>
  <body>
    <form action="myscript.php">
      Username: <input type="text" pattern="[a-zA-Z][\w]{3,8}[a-zA-Z]" name="username" required="required"/><br/>
      Name: <input type="text" pattern="[^0-9\\|!&quot;@#£$§%&/()=?{[\]}'«»*+]+" name="realname" required="required"/><br/>
      Zip Code: <input type="text" pattern="[0-9]{4}-[0-9]{3}|[0-9]{4}" name="zipcode" required="required"/><br/>
      Ipv4 Address: <input type="text" pattern="(([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])" name="ipv4" required="required"/><br/>
      Mac Address: <input type="text" pattern="[a-fA-F0-9]{2}(:|-)([a-fA-F0-9]{2}\1){4}[a-fA-F0-9]{2}" name="mac" required="required"/><br/>
      Password: <input type="text" pattern="(?=.*[0-9].*[0-9])(?=.*[;\.:].*[;\.:])([\w;\.:])[\w;\.:]{4,}(?!\1)[\w;\.:]" name="password" required="required"/><br/>
      <input type="submit" value="Try"/>
    </form>
  </body>
</html>