Given a string, determine whether it contains a repeated substring pattern and return the matching pattern if one exists.