Fix the problem with the regex

Remove the end char $