Have tried to read about regex expressions but don't succeed. Maybe there is an easier way to do this.
I want to replace the space between first name and surname in a payload with %20.
The payload is for example John Sander and I want the output to be John*%20Sander
I suspect what you are trying to do is make it into a uri - so the encodeURI function may just do what you want - and would work for other "odd" characters as well