Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Pattern mattching

by TedPride (Priest)
on May 30, 2005 at 08:36 UTC ( [id://461714] : note . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $c = '+000000';
    print 'contains' if $c =~ /\+\d\d\d\d\d\d/;
    
  2. or download this
    my $c = '+000000';
    print 'contains' if $c =~ /\+\d{6}/;
    
  3. or download this
    my $c = '+000000';
    print 'contains' if $c =~ /^\+\d{6}$/;
    # or...
    print 'contains' if $c eq '+'.'0'x6;