I am trying to convert a camel cased QString into lowercased words separated by spaces. I currently have:
QString camelCase = "thisIsACamelCaseWord"
QString unCamelCase = camelCase.replace(QRegularExpression("([A-Z])", " $1")).toLower();
Which seems to work here,
"this Is A Camel Case Word"
but it is returning with:
"this $1s $1 $1amel $1ase $1ord"
CodePudding user response:
Since QRegularExpression uses PRCE the back reference syntax is '\0', '\1' and so on as explained in the documentation.