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