I am trying to find a similar function to strstr that searches a substring starting from the end towards the beginning of the string.
strstr
Though non-standard, strrstr is widely supported and does exactly what you want.