in reply to Re: Help with a more precise regex
in thread Help with a more precise regex
And it seems to work! Thanks, LogicalChaosif ( $value and $value !~ /^(?:(\d+)d)?(?:\s*(\d+)h)?$/i ) { $result = "Please only enter time in one of these three formats: ' +3d', '4d 3h', '22h'"; } else { $day = $1 || 0; $hour = $2 || 0; }
|
|---|