Javascript regular expression: \r |
<input type="button" value="Match" onclick="javascript:demo('aaa\r');return false;" /> <input type="button" value="No Match" onclick="javascript:demo('aaa');return false;" /> <script type="text/javascript" language="JavaScript"> //<![CDATA[ function demo(text) { var re = /\r/; if (text.match(re)) { alert("match"); } else { alert("no match"); } } //]]> </script> |