I changed VitalyB's code to support Color Themes. Instead of blocking user input if it doesn't meet the RegEx script, it just highlights the text box. The text box will be the theme default without interaction, and then defaults to a light green or red depending on the value after the input is set. You can also set the fail and pass colors programatically with: