Evaluate fields before submit for a search view

I have a test search form set up here: Knack.
What I want to do is grab whatever was input into the first field on the form, evaluate it and potentially clean up the data using regex before submit. I see that my view is view_1 and the search input is pages/scene_2/views/view_1/search/rows/0/columns/0/inputs/1 but I’m not sure how to target it and do I need to do this using javascript or could it be done in a text formula? Thanks for any quick pointers. Cheers, Carolyn V.