The "" character has two very different meanings in the regex, depending on where it is uses. At the very beginning (as in your past post) it "anchors" the following regex to the beginning of the string. (Likewise, "$" is the end-of-string anchor when it is the last character in the regex.) When it is the first character following the opening "[" of a character class, then it negates that class, meaning to match on any character that is not a member of that class. So your two options in this case are:
if(!preg_match('/^[a-zA-Z0-9\.\-\Ä\ä\Ö\ö\Ü\ü\ ]$/', $_POST['fname'])) {
// invalid first name
}
// ...or...
if(preg_match('/[^a-zA-Z0-9\.\-\Ä\ä\Ö\ö\Ü\ü\ ]/', $_POST['fname'])) {
// invalid first name
}
In the latter case, note that there is no start-of-string nor end-of-string anchor, and no negation "!" before the preg_match().
As far as the undefined variable, that has nothing to do with the regex. Probably you have a mismatch between the index name you are using for the $_POST array variable and the "name" attribute value assigned for it in the HTML form. Make sure that the spelling is exactly the same, including capitalization (e.g.: 'Fname', 'fName', and 'fname' are three different names).