Quote Originally Posted by jdiewald View Post
If you use this structure, you should also add a default clause to the switch, with an assertion failure or exception. This will protect you against the inevitable day when something in the code changes and more than one of the regular expressions succeeds.
He's reading the data from a (external) file. Adding assertions/exceptions can be quite dangerous. The programm should not crash every time the file is messed up.