Without extension

Tips on writing regular expressions for searching the post list

Moderators: Quade, dexter

Without extension

Postby ozzii » Wed Mar 15, 2006 7:07 am

I tried, but without success, to create a filter who hide all the subjects without extension.

It's for not showing (for example) the request message.

Any advice, please :?:
ozzii
Seasoned User
Seasoned User
 
Posts: 410
Joined: Thu Feb 23, 2006 6:10 pm
Location: France

Registered Newsbin User since: 02/23/06

Postby bobkoure » Tue Apr 04, 2006 9:31 pm

By extension you mean like in DOS and windows dot-char-char-char? With either a newline, tab, or space trailing the extension?
How about
\.\w{3}\W

If you want to match the above plus dot-char-char-char-char (as in .flac and .divx)
\.\w{3}\w*\W

I've just tried this in the find window and it seems to work fine.
bobkoure
 

Postby Quade » Tue Apr 04, 2006 9:39 pm

It supports the {2-4} syntax too.
User avatar
Quade
Eternal n00b
Eternal n00b
 
Posts: 44972
Joined: Sat May 19, 2001 12:41 am
Location: Virginia, US

Registered Newsbin User since: 10/24/97

Postby ozzii » Wed Apr 05, 2006 2:57 am

Yes, I mean like in dos.
I will try that thanks.
ozzii
Seasoned User
Seasoned User
 
Posts: 410
Joined: Thu Feb 23, 2006 6:10 pm
Location: France

Registered Newsbin User since: 02/23/06

Postby bobkoure » Wed Apr 05, 2006 2:24 pm

Based on Quade's comment you can also use
\.\w{3-4}\W
where 3-4 means at least three but not more than four characters following a dot -

[edit]
actually, that will miss extensions at the very end of the line (that trailing \W means an actual non-word character) - instead, use
\.\w{3-4}\b
where \b just means a word boundary, which could be the end of the line
[/edit]
bobkoure
 


Return to Regular Expressions

Who is online

Users browsing this forum: No registered users and 2 guests