- added hand writen error on empty string
- replace switch with a simple if
- and remove the 'i' from RegExp, stupid idea...