I need to make sure that a field contains ONLY letters... and this is the
regular expression I'm using:
$name=~/^[a-zA-Z]+/
it doesn't seem to be working in the test script that I wrote:
#!/usr/bin/perl -w
print "what's your name?";
$name=<STDIN>;
chomp $name;
$flag=$name=~/^[a-zA-Z]+/;
if (!$flag) {
print "sorry... try again.\n";
}
else {
print "woo hoo!\n";
}
what am I doing wrong? also, will said regular expression accept foreign
characters as letters, like an umlaut? (ö)
`°º¤,ô¿ô,¤º°``°º¤,ô¿ô,¤º°``°º¤,ô¿ô,¤º°``°º
Stephanie J. Stiavetti
Production Tools
Industrial Light + Magic
415-448-3213 <-|-> [EMAIL PROTECTED]
`°º¤,ô¿ô,¤º°``°º¤,ô¿ô,¤º°``°º¤,ô¿ô,¤º°``°º
And then the day came when the risk to
stay tight in a bud became more painful
than the risk it took to blossom.
--Anais Nin
`°º¤,ô¿ô,¤º°``°º¤,ô¿ô,¤º°``°º¤,ô¿ô,¤º°``°º
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]