If you want on-the-fly validation for an exposed filter, you can use this jQuery plugin:
Things to do:
1. Add the plugin file to the page: One way of doing this is, download the js file, place in your theme's folder and include it in your theme's info file. Add this line to the info file:
scripts = jquery.valid8.js
You can also include the script for just that view's output page by including the code from the plugin in the header of the views.
2. Add this kind of code to the header of the view (don't forget to select Full HTML or PHP code as input format):
// code for validation (regex etc.)
That is it. More examples about validation can be found on the plugin's webpage.
Note: You may need to check the version of jQuery you are using. If it is not compatible with the plugin, you can use JQuery update module...