javascript - Filter non-Alpha characters for multiple languages -
i want write regex remove non alpha characters, follows:
björn -> björn barry's -> barrys who? -> cibé? -> cibé i'd -> id ice-cream -> icecream no!!! -> no [{brackets}] -> brackets ~inv3rse -> invrse
and convert characters lowercase versions. how do languages or @ least european languages using latin script?
str.tolowercase().replace(/[^a-z]/gi,'');
this convert lowercase, replace isn't alphabetic character (a-z) empty string, removing them. in order keep other characters (like e accent mark) add symbol regex.
Comments
Post a Comment