I am looking for a way to remove all numbers and letters in brackets, as well as numbers not associated with a letter (i.e. I want to keep 'v2'
or 'vol.2'
).
For instance:
"My Notes v02 003 (2009) (My sillyness)"
would become:
"My Notes v02".
I have found ways to remove the data in the braces and the braces themselves, however the issue I have now is removing the numbers not associated with a volume identifier.
Currently I have:
QString myItem = "My Notes v02 003 (2009) (My sillyness)";
myItem = myItem.remove( QRegExp( "\\[.*\\]|\\(.*\\)" ) );
Do I need to break the strings up into individual words and check manually? Or is there a better solution?