Replace diacritic letters with equivalent
I'm trying to replace:
á, ă, â ...
with a
í, ì, ĭ, î, ǐ, ï, ḯ ...
with i
ú, ü ...
with u
And so on.
What I am doing now is this: str.replace(/[íìĭîǐïḯ开发者_如何转开发]/gi,'i'
.
Is there a better way of doing this?
As far as I know you have to match each group. Take a look into this example, although it is javascript it's very complete script and easy to get it to work in actionscript: http://lehelk.com/2011/05/06/script-to-remove-diacritics/
精彩评论