Help for this page

Select Code to Download


  1. or download this
    c:\@Work\Perl\monks>perl -wMstrict -le
    "my $line = '2011-01-01 15:34:554 some words and numbers then email@ho
    +st.com';
     printf qq{date '%s' time '%s' email '%s' \n}, (split /\s+/, $line)[0,
    + 1, -1];
    "
    date '2011-01-01' time '15:34:554' email 'email@host.com'
    
  2. or download this
    c:\@Work\Perl\monks>perl -wMstrict -le
    "my $rx_d = qr{ \d{4} - \d\d - \d\d }xms;
    ...
    [2011-01-01 15:34:55 blah blah yada email@host.com
    ]
    d '2011-01-01'  t '15:34:55'  e 'email@host.com'