Added a simple test and refactored the regexp