Fix a regression and make use of the proper anchor to get the end of string