Q: Qt Regular Expressions assistance required I'm trying to construct a regular expression to retreive file types from a strictly formatted string.  The format is along the lines of
"Image formats (*.png *.jpg *.bmp)"
My first theory was to search for strings beginning with '*' then '.' then match (and capture) any character until it found a space or round bracket such as.
QRegExp re("\\*\\.(.*)[\\s|\\)]") 
Which gives me the following (with minimal enabled)
"*.png" and "png"
I have also tried using the \w (word character) but to no prevail. The Regular expression engine uses perl syntax and backslashes also need to be 'escaped' since c++ also processes them.
Question:
I need a regular expression to search for file types from a strictly formatted string, i.e from the string above I would need 3 strings "png", "jpg" and "bmp".
Thanks in advance for any suggestions!

A: QString str = "Image formats (*.png *.jpg *.bmp)";
QRegExp re("([*][.](.*))[\\s|\\)]"); // "(\\*\\.(.*))[\\s|\\)]" - also works
re.setMinimal(true);

int pos = 0;
while ((pos = re.indexIn(str, pos)) != -1)
{
    qDebug() << re.cap(1) << re.cap(2);
    pos += re.matchedLength();
}

Output:
"*.png" "png"
"*.jpg" "jpg"
"*.bmp" "bmp"

