Clean up example logic using graphemes/pattern matching

This PR cleans up some of the logic in the phone_number example by using pattern matching.

The case is removed as well as the temporary assignment of "r" (for the case expression).