calculate seconds, regex version