Home › Forums › JavaScript › convert uppercase to lowercase and vice-versa › Reply To: convert uppercase to lowercase and vice-versa
March 18, 2017 at 12:59 pm
#252910
Mottie
Member
Update: There is a limitation of the above code… lower-case letters with diacritics will not be modified. You would need to include all lower case unicode characters, which isn’t as simple as it sounds because you can’t add a simple range into the regular expression because upper & lower case letters alternate (ref).
Here is a demo that includes a lesser subset of diacritics which only requires the change of this line:
var lc = /[a-zàèìòùáéíóúýâêîôûãñõäëïöüÿçßøåæœ]/;