Working algorithm, divides strings by a pattern, returns a vector by reference