The action handler is not designed for that sort of usage.
What you should do instead is to use the "Validation" field when you add a property to your document type. In that field you can enter a Regular Expression, and umbraco will validate the entered value for you.