Validate a field using custom function

Validate a field using custom function

Urgent

I have a field which should take input in format of AAB-X-112 i.e. first 3 characters then a hyphen then 1 character, a hyphen and then 3 numbers.

How can I make sure that user inputs exactly in the required format.

Custom Function is looking like a hope. Any ideas? or other thoughts to get it done.

Does Deluge support Regular Expressions any how???