Javascript examples for RegExp:RegExp Match
Preg match on string with regex
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> function func(i) { var regex = /^(?!Mozilla)/;/* www . j a v a 2s . c o m*/ var input = document.getElementById('input').value; var result = regex.test(input); document.getElementById('result').innerHTML = 'Result: ' + result; } </script> </head> <body> <div> <input type="text" id="input" value="Mozilla"> <button onclick="func()">Test</button> <span id="result"></span> </div> </body> </html>