Javascript examples for RegExp:RegExp Match
Javascript Alphanumeric regular expression taking new line character
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.8.3.js"></script> <script type="text/javascript"> $(function(){//from w w w .j a v a 2 s. c o m $("#textArea1").change(function(){ var regex = new RegExp(/^[0-9a-zA-Z\s\r\n]+$/); console.log(regex.test($("#textArea1").text())); }) }); </script> </head> <body> <textarea id="textArea1"> </textarea> </body> </html>