Drastically simplified string to matrix conversion by using regex pattern.
Cleanup