in reply to Re: Time to seconds
in thread Time to seconds
$timestr =~ /^(?:(\d+)H)?(?:(\d)+M)?(\d+)S$/;with
$timestr =~ /^(?:(?:(\d+)H)?(\d)+M)?(\d+)S$/;.
The difference is that the first will accept 10H5S, while the second won't. (And you'll be testing that the match succeeds in real code, of course).
|
|---|