Amazon Interview Question

Create a function to perform a regex search on a string that maximizes the length of the found substring