TGFileInfo + TRegexp

Dear Rooters,

I would like to pass a filter to TGFileInfo a la:

const char *filetypes[] = { "Image files", "png|jpg|gif",...
TGFileInfo* fi = new TGFileInfo();
fi->fFileTypes = filetypes;

TGFileContainer however uses TRegexp which does not support
the | (or) . (Yes I do know about TPRegexp, but it doesnt help here)

Is there a workaround which I dont see?


Hi Otto,

I don’t know TRegexp very well, but this works for me:

const char *filetypes[] = { "Image files", "*.[p|j|g][n|p|i][g|g|f]", 0, 0 };
But there is probably a better solution… :wink:

Cheers, Bertrand.

HI Bertrand,

at least you know regexp better than I do.

Thanks for your help