Help for this page

Select Code to Download


  1. or download this
        my $re = shift or die "re expected\n";
        while (<>) {
    ...
            my ($field, $value) = ($_ =~ $re);
            print "'$_' -> ('$field', '$value')\n";
        }
    
  2. or download this
     'a:b:c' -> ('a', 'b:c')
     'a\:b:c' -> ('a\:b', 'c')
    ...
     'a\\\:b:c' -> ('a\\\:b', 'c')
     'a:' -> ('a', '')
     ':b' -> ('', 'b')
    
  3. or download this
     
     'a\:b' -> ('', 'b')
    
  4. or download this
     ^((?:[^:\\]+|\\.)*):(.*)