Filter a field (with regex) in a view
"Filters" have certain meaning in Views. They are this little things that give "go" or "no-go" to result rows. What you seems to want is to rewrite user's input, not filter.

hook_form_alter I see in your tags is actually a good call. You can use it to append AJAX to onblur and make it rewrite field. Or you can use validation function

function yourmodule_form_validate($form, &amp;$form_state) {
  $form_state['input']['yourfield'] = _mymodule_sanitize( $form_state['input']['yourfield'] );
}


to rewrite it after user's submit, but before it is used by views. This function takes &amp;$form_state by reference. It means you are allowed not only to read it, but also write to it, and your changes will be visible for all submit functions attached to your form, and will be used in next rendering of your form in case of validation errors or multis-tep forms.