Javascript regular expression: /i |
<input type="button" value="Match1" onclick="javascript:demo('WOrld');return false;" /> <input type="button" value="Match2" onclick="javascript:demo('aaWORLDbb');return false;" /> <script type="text/javascript" language="JavaScript"> //<![CDATA[ function demo(text) { var re = /world/i; if (text.match(re)) { alert("match"); } else { alert("no match"); } } //]]> </script> |