JSFiddle - React, Tailwind, and code Playground
HTML
<div id="time"></div>
<div id="result">
</div>
CSS
.valid .ok, .invalid .ko {
color: green
}
.valid .ko, .invalid .ok {
color:red
}
JavaScript
var addresses = {
valid: [
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'user@[127.0.0.1]',
'user@[IPv6:2001:db8:1ff::a0b:dbd0]',
'"much.more unusual"@example.com',
'"[email protected]"@example.com',
'"very.(),:;<>[]\\".VERY.\\"very@\\\\ \\"very\\".unusual"@strange.example.com',
'postbox@com',
'admin@mailserver1',
'!#$%&\'*+-/=?^_`{}|[email protected]',
'"()<>[]:,;@\\\\\\"!#$%&\'*+-/=?^_`{}| ~.a"@example.org',
'" "@example.org',
'üñîçøðé@example.com',
'üñîçøðé@üñîçøðé.com',
'"Abc\\@def"@example.com',
'"Fred Bloggs"@example.com',
'"Joe\\\\Blow"@example.com',
'"Abc@def"@example.com',
'customer/[email protected]',
'\\[email protected]',
'!def!xyz%[email protected]',
'[email protected]'
],
invalid: [
'[email protected]',
'[email protected]',
'[email protected]',
'Abc.example.com',
'A@b@[email protected]',
'a"b(c)d,e:f;g<h>i[j\\k][email protected]',
'just"not"[email protected]',
'this is"not\\[email protected]',
'this\\ still\\"not\\\\[email protected]'
]
};
paperKnife = (function(){
/* Generated by PEG.js (http://pegjs.majda.cz/). */
var result = {
/*
* Parses the input with a generated parser. If the parsing is successfull,
* returns a value explicitly or implicitly specified by the grammar from
* which the parser was generated (see |PEG.buildParser|). If the parsing is
* unsuccessful, throws |PEG.grammarParser.SyntaxError| describing the error.
*/
parse: function(input) {
var pos = 0;
var rightmostMatchFailuresPos = 0;
var rightmostMatchFailuresExpected = [];
...