WMA link
Shortest
StringCases["aabaaab", Shortest["a" ~~ __ ~~ "b"]]
StringCases["aabaaab", Shortest[RegularExpression["a+b"]]]