<html>
<head>
<script>
function aa(object)
{
var text = object.value;
if (text.match(/C:\\aa\\a.txt/))  //C:\aa\a.txt
alert(text + ' is correct');

//IP
if (text.match(/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/))
alert(text + ' is a valid IP address');

//Mac: Mac地址以空格,"-",":"分开
if (text.match(/^([0-9a-fA-F]{2})(([/\s:-][0-9a-fA-F]{2}){5})$ /)) //
alert(text + ' is a valid Mac address');
}
</script>
<head>
<body>
<input type="text" name="downfile" onBlur="aa(this)"
   style="width: 200px; height: 20px" />
</body>
</html>