Ok. I don't know what basics of regular expressions you know, but lets try explaining this. However, I'm going to use perl compatible regular expressions (PCRE), which you would you preg_match as the function.
/(([A-Za-z]),\s?)?([A-Za-z]*)$/
The first / just means we are starting. The ^ means start at the beginning of the string. Then, we have any character and number of times, the is a greedy operator that just matches anything before it any number of times. Then we have a comma, and a space (maybe) the question mark means we can have a space or we can't, it doesn't matter. The next means match the previous any number of times. Then, match the last work and the final $ means match the end of the string. So if you do:
if (preg_match("/(([A-Za-z]),\s?)?([A-Za-z]*)$/", $string)) {
echo "OK";
} else {
echo "Bad";
}
You should be ok. Hope that helps!
Chris King