Can you also add checks here should the regex fail (on e.g. FreeBSD).