Continuing regex implementation. By using regex Im thinking I resolved the issue of spaces I was having with the matrix