Dr.Ruud wrote:
Michael Alipio schreef:

$log  = "date=2007-01-12 blah blah";
[...]
    ($date) = $log =~
    /date=(\S+?)[\s+|,]/;

/date=([0-9]{4}-[0-9]{2}-[0-9]{2})\b/; /date=([0-9]{4}(?:-[0-9]{2}){2})\b/;
      /date=([0-9-]{10})\b/;

      /date=([0-9-]+)\b/;

(untested)

Why would you not test the code you posted?

$log =~ /date=([\d-]+)/;

will do what is required here.

Rob

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to