File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -217,12 +217,27 @@ console.log(isEmpty(obj)); // true
217217
218218** ⚝ ; [ Try this example on CodeSandbox] ( https://codesandbox.io/s/js-cp-isempty-b7n04b?file=/src/index.js ) **
219219
220+ <div align =" right " >
221+ <b><a href="#">↥ back to top</a></b>
222+ </div >
223+
220224## Q. *** JavaScript Regular Expression to validate Email***
221225
222226``` javascript
223- var pattern = / ^ \w + @[a-zA-Z _] +? \. [a-zA-Z ] {2,3} $ / ;
227+ function validateEmail (email ) {
228+ const re = / \S + @\S + \. \S + / ;
229+ return re .test (email);
230+ }
231+
232+ console .log (validateEmail (" pradeep.vwa@gmail.com" )); // true
224233```
225234
235+ ** ⚝ ; [ Try this example on CodeSandbox] ( https://codesandbox.io/s/js-cp-validateemail-wfopym?file=/src/index.js ) **
236+
237+ <div align =" right " >
238+ <b><a href="#">↥ back to top</a></b>
239+ </div >
240+
226241## Q. *** Use RegEx to test password strength in JavaScript?***
227242
228243``` javascript
You can’t perform that action at this time.
0 commit comments