Utopian Identification Number

The following is the solution to the Hacker Rank problem “Utopian
Identification Number".
Algorithm > Regex > Utopian Identification Number