Filtering filenames that START WITH something?

Tips on writing regular expressions for searching the post list

Moderators: Quade, dexter

Filtering filenames that START WITH something?

Postby mountainsoft » Mon Oct 27, 2014 1:12 pm

I want to filter filenames that begin with text like "ng" (such as ng.sample, or ng-test) but don't want to filter filter names that have "ng" in them (such as "working" or "bang" or "sample.ng").

How would I do this?
mountainsoft
Occasional Contributor
Occasional Contributor
 
Posts: 13
Joined: Fri Mar 07, 2014 12:26 pm

Registered Newsbin User since: 01/09/14

Re: Filtering filenames that START WITH something?

Postby Quade » Mon Oct 27, 2014 2:16 pm

"^ng" should to it.

"^" means "tied to beginning of the line".

This works in the filename filters. It won't work so well in the subject filters because ^ would be the beginning of the subject, not the filename.

If you want to use something like that in the subject filters, you'd have to key on something other than the beginning of the line. For example if all filenames are quoted (most of them are)

"["]ng.*["]"

Might do it. Meaning match anything that starts with a quote followed by ng...any characters, then another quote.

You can test the subject ones in the "find" box. Don't include the outer quotes.
User avatar
Quade
Eternal n00b
Eternal n00b
 
Posts: 45003
Joined: Sat May 19, 2001 12:41 am
Location: Virginia, US

Registered Newsbin User since: 10/24/97

Re: Filtering filenames that START WITH something?

Postby mountainsoft » Mon Oct 27, 2014 2:26 pm

My bad, it was the subject I was wanting to filter. Your second example seems to be working fine. Thanks!
mountainsoft
Occasional Contributor
Occasional Contributor
 
Posts: 13
Joined: Fri Mar 07, 2014 12:26 pm

Registered Newsbin User since: 01/09/14


Return to Regular Expressions

Who is online

Users browsing this forum: No registered users and 22 guests