JSFiddle - React, Tailwind, and code Playground

by ChrisStanyon

HTML

<input id="email" />
<p id="response"></p>

JavaScript

var expr = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
$("#email").keyup(function () {
    var response = expr.test( $("#email").val() ) ? "Looks Good!" : "Invalid";
    $('#response').html(response);
});