Add pattern to input field