Filters

Technical support and discussion of Newsbin Version 6 series.

Filters

Postby Zach » Thu Dec 11, 2014 4:54 pm

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?
User avatar
Zach
Active Participant
Active Participant
 
Posts: 53
Joined: Sun Nov 07, 2004 6:11 pm

Registered Newsbin User since: 11/07/04

Re: Filters

Postby Quade » Thu Dec 11, 2014 5:42 pm

"[\.]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.
User avatar
Quade
Eternal n00b
Eternal n00b
 
Posts: 44984
Joined: Sat May 19, 2001 12:41 am
Location: Virginia, US

Registered Newsbin User since: 10/24/97

Re: Filters

Postby Zach » Thu Dec 11, 2014 7:05 pm

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!
User avatar
Zach
Active Participant
Active Participant
 
Posts: 53
Joined: Sun Nov 07, 2004 6:11 pm

Registered Newsbin User since: 11/07/04

Re: Filters

Postby Quade » Thu Dec 11, 2014 7:07 pm

RE's are really their own programming language. There's many aspects I still have to look up.
User avatar
Quade
Eternal n00b
Eternal n00b
 
Posts: 44984
Joined: Sat May 19, 2001 12:41 am
Location: Virginia, US

Registered Newsbin User since: 10/24/97


Return to V6 Technical Support

Who is online

Users browsing this forum: No registered users and 2 guests