Removing non-Latin characters from a string

javascript, unicode

Solution

Try this:-

 text.replace(/[\u0250-\ue007]/g, '');

Problem

I'm trying to remove non-Latin characters from a string with Javascript. I'm using the following code: ``` text.replace(/[\u0250-\ue007f]/g, '') ``` I first thought it was working fine, until I discovered it also removes the 'f' character from the string. Any suggestions?

Original source