Brion Vibber wrote:
Timwi wrote:
Ævar Arnfjörð Bjarmason wrote:
Changed it to /^([á|ð|é|í|ó|ú|ý|þ|æ|ö|a-z]+)(.*)$/sD , works like a charm
I'm not sure, but this looks like it would also expand on the | character.
You want just: /^([áðéíóúýþæöa-z]+)(.*)$/sD
That won't work with UTF-8.
Brion, you're too quick to reply again. I have to admit that I didn't think of UTF-8, but:
(a) it *does* work with UTF-8, albeit accidentally, and (b) either way it's more correct than the other version. You do *not* want a "|" character inside square(!) brackets.
Given the concerns with UTF-8, Ævar, I suggest you use:
/^((?:á|ð|é|í|ó|ú|ý|þ|æ|ö|[a-z])+)(.*)$/sD
Greetings, Timwi