Google search button but remove rest after it detects four numbers from left

Sir I know nothing of scripting and i was hoping u can help me with that button just like u did that before yrs ago.