Find the continuous pattern in a given string