abkarim / school-management-system Goto Github PK
View Code? Open in Web Editor NEWSchool management system in decoupled architecture
License: MIT License
School management system in decoupled architecture
License: MIT License
I using a util function in react /gui-development/src/util/isEmail.js
that checks a string with regex to validate is valid email or not
/**
* Check a string is a email or not
* @param {string} email
* @returns {boolean} is email
*/
export default function isEmail(email) {
/**
* Regex
*
** username group
* start with char_u
*
* OPTIONAL group
* - start with (.)
* - char_u group
*
** @
*
** domain group
* start with char_d
* (.)
* char_d
*
* OPTIONAL group
* - char_d
* - (.)
* - char_d
*/
// TODO : Solve error
let match = email
.trim()
.match(
/^(?'username'(?'char_u'[A-z0-9-#`!%$&+*/=?^-_{|}~]+)([.](?&char_u))?)@(?'domain'(?'char_d'[A-z-0-9-_]+)[.](?&char_d)([.](?&char_d))?)$/
);
return match !== null;
// return true;
}
But I got this error
ERROR in ./src/util/isEmail.js 33:34
Module parse failed: Invalid regular expression: /^(?'username'(?'char_u'[A-z0-9-#`!%$&+*/=?^-_{|}~]+)([.](?&char_u))?)@(?'domain'(?'char_d'[A-z-0-9-_]+)[.](?&char_d)([.](?&char_d))?)$/: Invalid group (33:34)
File was processed with these loaders:
* ./node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js
* ./node_modules/babel-loader/lib/index.js
* ./node_modules/source-map-loader/dist/cjs.js
You may need an additional loader to handle the result of these loaders.
|
| // TODO : Solve error
> let match = email.trim().match(/^(?'username'(?'char_u'[A-z0-9-#`!%$&+*/=?^-_{|}~]+)([.](?&char_u))?)@(?'domain'(?'char_d'[A-z-0-9-_]+)[.](?&char_d)([.](?&char_d))?)$/);
| return match !== null;
|
webpack compiled with 1 error
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.