find a path in a string matrix