JS filter and replace defined characters