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