Adds a test and fixes an issue with the regex