How to write a regex expression which accepts multiple dots(eg: abc.bgh.asd@gmail.com) and ( - ) in React.Js?

Viewed 22
let expression = /^[ A-Za-z0-9](\.?[ A-Za-z0-9.-]){1,}@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
let regex = new RegExp(expression);
return expression.test(value);

I wrote like this but it is accepting words such as abc.bdf.gh-.@gmail.com.

How can I modify such that - and . should not accept before @ symbol.

0 Answers
Related