I believe you're mixing up your syntax here (but IANAE when it comes to regexps...)
"[a-zA-Z]" is POSIX compatible string, so you'd need to use [man]ereg/man to make it work. Maybe like this:
$exp="[a-zA-Z]";
$string="foo34foo";
if (ereg($exp,$string)) {
// do something
}
Only problem, as you've already noticed: it matches any occurence of a "letter" ...
In the Perl-Compatible Syntax (used with preg_match and friends), the class "w" is roughly equivalent to [a-zA-Z0-9] in POSIX syntax, so once again, you can get a number to match.
Off the top of my head (without much study), I've this:
<?php
$exp="[!-@{-~]";
$string=array("f?jdksl","foo", "bar", "!3j3","1234");
foreach ($string as $s) {
if (!ereg($exp,$s)) {
echo "$s is true \n";
} else {
echo "$s is false! \n";
}
}
?>
Dunno if it's much help, though... and, it still might let a stray char or two into your input. I'm quite braindead ATM (it's Saturday night...) ... mebbe someone lucid can come along and help before too much longer...