How format field to remove special characters, and space?

How format field to remove special characters, and space?

Hi, in phone field creation, i want ignore spacial caracters and space. 

For example, if input is 

22 99933-2334

it wll format to 22999332334

I also, would like to add +55 in beginning, so it will be formated to +5522999332334

Last thing is, if phone typed, has 11 caracters and starts with 55, then only add + in beginning..

So if phone is 5522 999332334 it formats to +5522999332334

How do it?