I have a QString
like "(ram[3].available@=> 10,2,25 &( cpu.load <> 42,49 |qweds[-1].ee0 ~\"arab lllss\" ) )"
and I want to enter white space after each non-alphabetic character (i.e. @
, ~
, (
and etc.) then split the string. I tried gSkinner online tool and I found that I need to replace \s*\W
with $&
to have the white space between special characters and alphanumeric characters. But I don't know how I can implement it in Qt using QregExp
and QString
.
Basically what I want to do is:
QString smth = "(ram[3].available@=> 10,2,25 &( cpu.load <> 42,49 |qweds[-1].ee0 ~\"arab lllss\" ) )";
Qstring smth2 = smth.replace("\s*\W\", "hereIdunnoWhattoPut");
QStirngList l = smth2.split(" ",QString::SkipEmptyParts);
qDebug() << l;
//( "(" , "ram" , "[" , "3" , "]" , "." , "available" , "@" , "=" , ">" , "10".... )