Help for this page

Select Code to Download


  1. or download this
      /^(?:$part:){5}$part$/;
      my @parts = split /:/;
    
  2. or download this
      my @parts = /^($part):($part):($part):($part):($part):($part)$/
  3. or download this
      my $re_mac_bUK = '(?: ( [0-9A-Z]{1,2} ) : )' x 5 . '( [0-9A-Z]{1,2} 
    +)';
      sub replace_bUK {
        s[^ $re_mac_bUK $]
         [ sprintf '%02s' x 6, $1, $2, $3, $4, $5, $6 ]ex;
      }
    
  4. or download this
      my $re_mac_ihb = qr/(?:$part:){5}$part/ . '';
      sub replace_ihb {
        /^ $re_mac_ihb $/x;
        $_ = sprintf '%02s' x 6, split /:/;
      }
    
  5. or download this
      /^(...$)/m
  6. or download this
      $_ = 'a ' x 1000;
      s/(\s+)$//; # Slower
      s/(\s+$)//; # Faster