0
![Stack Overflow](http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png)
You can compile regular expressions from strings like so:
var regexCompiled = new RegExp(regex);
txb.value = inputbox.value.replace(regexCompiled, "");
Also, you are probably missing quotation marks around your pattern:
"regex": "^([0-9]|0[0-9]|1[0-3]|2[0-3]):[0-5][0-9]$",
and of course, yo...