storj/web/satellite/src/utils/validation.ts
Bogdan Artemenko f9fbda1ec5
Auth logic additions (#710)
* Added License reference at the beginning of each file
2018-11-27 12:51:33 +02:00

8 lines
337 B
TypeScript

// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
export function validateEmail(email: string) : boolean {
const rgx = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return rgx.test(email);
}