Hi everybody,

I am a beginner of programming ( so I am a beginner of perl programming too :-) ) and I have this very basic problem but cannot handle it.

I'm trying to match only a one single digit and wrote this code:


use strict;


my $number = 11; # two-digit number

if ( $number =~ /\d{1}\b/ ) {
        print "Match\n";
} else {
        print "No Match\n";
}

But I get a match !?
I also tried:

  $number =~ /\d?\b/
because ? stands for no or one character

But that didn't work either.

Can someone give me a hint and maybe a source for more
basic dokumentation about reg exp.

Thanks for your time and have a nice day





--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to