More help humbly requested

Tips on writing regular expressions for searching the post list

Moderators: Quade, dexter

More help humbly requested

Postby RonMarz » Sat Jun 11, 2005 11:27 pm

How would I write a regex filtering out all three of the following terms?

Superman #312.rar
Superman #313.zip
Superman and Lois.zip

My best guess was "superman*\rar|zip, " but that didn't work.

Thanks to anyone who can help me see a little clearer.
RonMarz
Active Participant
Active Participant
 
Posts: 54
Joined: Fri May 31, 2002 3:00 pm

Registered Newsbin User since: 04/25/03

Postby Quade » Sun Jun 12, 2005 12:08 am

superman.*[.]rar
superman.*[.]zip

I don't have much luck with the OR operator. I just add multiple filters.

superman* means "superman with 0-N "n" at the end of it.
superman.* means "superman with 0-N <any char>"

[.]rar mean ".rar". I just like bracket escaping instead of \ but.

\.rar should mean the same thing.
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

Postby Smite » Mon Jun 13, 2005 12:20 am

I just make a point of using brackets to seperate the scope of the OR

"superman.*((rar)|(zip))" should work, though I'm not sure why you don't just use "superman"
Please read the FAQ before asking any questions.
If you're new to newsgroups, and the files on them, you can find a very helpful guide here.
User avatar
Smite
Katamari Damacy Addict
 
Posts: 5318
Joined: Sat May 19, 2001 1:54 am
Location: Alberta, Canada

Registered Newsbin User since: 03/27/03

Postby Quade » Mon Jun 13, 2005 1:48 am

Good point
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


Return to Regular Expressions

Who is online

Users browsing this forum: No registered users and 12 guests