Page 1 of 1

Filters

PostPosted: Thu Dec 11, 2014 4:54 pm
by Zach
I recall a few years ago, like maybe back in the v4 days, Quade said something about an update where anywhere and everywhere a filter was being used it supported regular expressions. With this in mind, I have a question about the default filters shipped with program, i.e., "Global," "Pictures," "Multimedia," etc.

Are those regular expressions, too? They seem to be given the "[.]jpe?g" entry in the "Pictures" filter. But if so, aren't all the initial periods incorrect? Shouldn't it be "[\.]jpe?g", or is a special exception being made for file filters?

Re: Filters

PostPosted: Thu Dec 11, 2014 5:42 pm
by Quade
"[\.]jpe?g",


\. and [.] mean exactly the same thing.

[.]jpg
\.jpg

You're double-escaping when you do: [\.]

It might work. I've never tried it. It's not necessary.

Re: Filters

PostPosted: Thu Dec 11, 2014 7:05 pm
by Zach
Quade wrote:You're double-escaping when you do: [\.]

*slaps forehead*

You know, now that you point that out, my jaw is dropping in amazement that that never occurred to me after now decades of my using regular expressions. :shock: I always thought a dot was a universal wildcard no matter where it was used. Never too old to learn! Thanks!

Re: Filters

PostPosted: Thu Dec 11, 2014 7:07 pm
by Quade
RE's are really their own programming language. There's many aspects I still have to look up.