Demonstrate Regex
HTML
<form id="myForm" method>
Input Here: <input id = "inp" type="text" size="100%"/><br/>
RegEx Here: <input id = "reg" type="text" size="100%"/><br/>
<input id = "mathc" type="button" value="Try Match" onclick="testRegEx()"></input>
</form>
JavaScript
function testRegEx() {
var re = new RegExp(myForm.reg.value);
var te = myForm.inp.value;
if (te.match(re)) {
alert(re + " Regular Expression DID match " + te);
} else {
alert(re + " Regular Expression did NOT match " + te);
}
}
function pasteDiv(myDiv)
{
myForm.reg.value = myDiv.innerHTML;
}