vector<Matrix> LoadMatrixes(string FileName)
{
int counter = 0;
ifstream f(FileName);
string line, temp;
regex squareBracketsRegex("\\[([^\\]\\[]+)\\]");
regex matrixRegex("(\\d+.\\d+)+");
while (getline(f, line))
{
if (line[0] == 'M' || line[0] == '-')
{
//end of matrix
cout << "----------------" << endl;
//regex search and append to vector of matrix
// "\[([^\]\[]+)\]" -> [...]
// "(\d+.\d+)+"
if (temp.length() > 0)
{
for (smatch m; regex_search(temp, m, squareBracketsRegex); temp = m.suffix())
{
//cout << m[1] << endl;
//Find each number
string row = m[1].str();
for (smatch n; regex_search(row, n, matrixRegex); row = n.suffix())
{
cout << n[1] << ", ";
}
cout << endl;
}
//clear temp
temp = "";
}
}
else
{
//Add line for regex
temp += line;
}
//Debug line
if (bDebug)
{
cout << "| " << counter << " | ";
if (counter % 8 == 0 && counter != 0)
{
cout << endl;
}
counter++;
}
}
return matrixes;
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}