Ronnie has asked for the wisdom of the Perl Monks concerning the following question:
This parameter must be exactly 3 characters in length and all the characters MUST be digits. What am I doing wrong? Be gentle I've already gone bald scratching my head over this one!#!/usr/bin/perl -w # use strict ; # my $step = 'a123aaaa' ; # Produces True message # if ($step =~ /\d{3}/) { print "\n\tIt's true :: <$step>!\n" ; } else { print "\n\tIt's false :: <$step>!\n" ; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Another RegExp question
by davis (Vicar) on Aug 17, 2006 at 11:20 UTC | |
by Ronnie (Scribe) on Aug 17, 2006 at 11:32 UTC | |
by cdarke (Prior) on Aug 17, 2006 at 11:54 UTC | |
|
Re: Another RegExp question
by ikegami (Patriarch) on Aug 17, 2006 at 15:17 UTC |