Javascript examples for RegExp:RegExp test
Get the result on regex test() method
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {/*from ww w . j ava 2 s .c o m*/ var string = "joe@aol.com"; var pattern = /[\w-]+@([\w-]+\.)+[\w-]+/i; var match = pattern.test(string); document.write(match); }); </script> </head> <body> </body> </html>