Help for this page

Select Code to Download


  1. or download this
    my $s='Tue Feb  8 11:11:11 2005: blah blah blah';
    my $regex=qr(^$wday $mon\s+$mday \d{2}:\d{2}:\d{2} $year:);
    ...
      print "found\n" if $line=~/$regex/;
    }
    
  2. or download this
    # interpolate the variables (you have to define your
    # variables to interpolate first so they work).
    my $regex="^$wday $mon\s+$mday \d{2}:\d{2}:\d{2} $year:";
    
    $regex=qr($regex); # compile the regular expression
    
  3. or download this
    my $s='Tue Feb  8 11:11:11 2005: blah blah blah';
    my $regex=createRegEx('Tue','Feb','8','2005');
    ...
    
      return(qr($regex));
    }