利用可能な IE のすべてのバージョンは、を使用している場合でもΜάρτιος
常に に変換されます。ΜΆΡΤΙΟς
.toUpperCase()
I assume the problem are the variants of some letters (http://de.wikipedia.org/wiki/Griechisches_Alphabet#Klassische_Zeichen).
For example the letters Σ σ Ϲ and ς are all a 'Sigma'. The first both are the classic ones, the other are variants. Another example would be Β, β and ϐ for 'Beta'.
To ensure that these variants are recognized i'd recommend a substition before creating the regex.
Here I made a short (possible incomplete) helper function to do this
function regextendVariants(s)
{
var variants = [
['β', 'ϐ'],
['ε', 'ϵ'],
['θ', 'ϑ'],
['κ', 'ϰ'],
['π', 'ϖ'],
['ρ', 'ϱ'],
['σ', 'Ϲ', 'ς'],
['φ', 'ϕ']
];
for (var j = 0; j < variants.length; j++) {
var variant = variants[j];
for (var k = 1; k < variant.length; k++) {
s = s.replace(variant[k], '['+variant.join('')+']');
}
}
return s;
}
This function converts your strings to
- Μάρτιο[σϹς]
- Μάιο[σϹς]
- Ιούνιο[σϹς]
- Ιούλιο[σϹς]
- Αύγουστο[σϹς]
- Νοέμβριο[σϹς]
These strings allows different variants of the same letter. I'm sure, this is grammatically incorrect, but it should be more solid to match the strings.
In your code you've to replace
var r = new RegExp(m, 'i');
with
var r = new RegExp(regextendVariants(m), 'i');
私が言ったように、私のバージョンの IE ではエラーが発生しないため、これが問題の最終的な解決策になるとは約束できませんが、そうであることを願っています ;)