Take this as example
QString("= LINK(aaa) + 2 + LINK(bbb) + LINK(ccc)");
I would like to find all text occurences that are contained within LINK().
In my case it should return aaa, bbb and ccc
Take this as example
QString("= LINK(aaa) + 2 + LINK(bbb) + LINK(ccc)");
I would like to find all text occurences that are contained within LINK().
In my case it should return aaa, bbb and ccc
Copyright © 2021 Jogjafile Inc.
Use
QRegExpfor that.QRegExp::indexInwill return the position of the first match. Add the length of the captured text allows you to browse the whole string.In my case, I have to use
QRegExp::setMinimal()to make the regex non greedy. If you have only letters or digits, you can change the pattern with womething likeQRegExp rx("LINK\\((\\w+)\\)")