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!
Output: