mirror of
https://github.com/TeamPiped/Piped.git
synced 2025-10-14 11:28:22 +00:00
Use regex to check for email on RegisterPage
This commit is contained in:
8
src/utils/Misc.js
Normal file
8
src/utils/Misc.js
Normal file
@@ -0,0 +1,8 @@
|
||||
export const isEmail = input => {
|
||||
// Taken from https://emailregex.com
|
||||
const result = input.match(
|
||||
//eslint-disable-next-line
|
||||
/^(([^<>()\[\]\\.,;:\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 result;
|
||||
};
|
Reference in New Issue
Block a user