Fixing the regular expression to use start and end of string instead of start and end of line.