Hey everyone,
I've been having troubles previously, some months to some year ago, with preg_match'ing on Swedish characters ÅÄÖ. I had no luck whatsoever after a few hours of trying different variations and today I wanted to revisit this as it is still a problem.
But I just can't figure out why it doesn't work, so I'm hoping you guys can help me out!
I have this preg_match;
preg_match('/^[a-z A-Z\Å\å\Ä\ä\Ö\ö\s*\d]+$/u', $variable)
and as soon as I have any ÅÄÖ in the variable, it just doesn't want to match on it.
Could you please help me out before I throw the computer out the window? 😥😥😥
What I want is to only allow a-z A-Z and the Swedish characters ÅÄÖåäö - it is a match for first/lastname of a person.