Cheat Sheet

Tips on writing regular expressions for searching the post list

Moderators: Quade, dexter

Cheat Sheet

Postby Smite » Sun Sep 05, 2004 9:46 pm

Last edited by Smite on Sat Mar 11, 2006 3:05 pm, edited 2 times in total.
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 dexter » Sun Sep 05, 2004 9:57 pm

Nice. I just stickyfied you.
User avatar
dexter
Site Admin
Site Admin
 
Posts: 9514
Joined: Fri May 18, 2001 3:50 pm
Location: Northern Virginia, US

Registered Newsbin User since: 10/24/97

Postby georger » Wed Feb 16, 2005 12:23 am

Did not see this on the cheat sheet, but is this right for filtering (out) numbers only?

^[0-9]+$

And this would be to filter out any jpg prefixed with numbers:


^[0-9]+$\.jpg

Yes?
georger
n00b
n00b
 
Posts: 2
Joined: Wed Feb 16, 2005 12:20 am

Postby dexter » Wed Feb 16, 2005 1:47 am

The ^ for "not" doesn't work. You can put

[0-9]+\.jpg

in the reject field, that will work.
User avatar
dexter
Site Admin
Site Admin
 
Posts: 9514
Joined: Fri May 18, 2001 3:50 pm
Location: Northern Virginia, US

Registered Newsbin User since: 10/24/97

Postby bobkoure » Sat Mar 11, 2006 1:01 pm

It's moved (slightly) to
Links not allowed for unregistered users
bobkoure
 

Postby mcwebtree » Sat Mar 11, 2006 3:33 pm

I was about to say, but surely the addresses are both exactly the same...

But then I noticed that Smite had edited his entry! D'oh.
mcwebtree
Seasoned User
Seasoned User
 
Posts: 165
Joined: Thu Dec 22, 2005 4:11 pm

Registered Newsbin User since: 12/22/05

Postby Smite » Sat Mar 11, 2006 6:02 pm

Yeah. Thanks for the heads up.
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 bobkoure » Wed Aug 09, 2006 5:32 pm

While we're at it, there's a complete regex tutorial at Links not allowed for unregistered users.
bobkoure
 

RegEx coach

Postby RevRagnarok » Wed Feb 25, 2009 11:29 pm

I have used RegEx Coach when I am doing Perl development, I like the way it will walk you thru stuff.
User avatar
RevRagnarok
Occasional Contributor
Occasional Contributor
 
Posts: 35
Joined: Thu Oct 20, 2005 8:18 am

Registered Newsbin User since: 10/20/05

Re: Cheat Sheet

Postby mbourgon » Thu Sep 01, 2011 5:17 pm

A waaaay late entry to the party.
You can also use \d instead of [0-9]. Saves a couple characters.
mbourgon
Active Participant
Active Participant
 
Posts: 55
Joined: Wed Mar 27, 2002 12:59 am

Registered Newsbin User since: 03/04/02

Re: Cheat Sheet

Postby Quade » Thu Sep 01, 2011 5:38 pm

Never too late for RE's.
User avatar
Quade
Eternal n00b
Eternal n00b
 
Posts: 44999
Joined: Sat May 19, 2001 12:41 am
Location: Virginia, US

Registered Newsbin User since: 10/24/97

Re: Cheat Sheet

Postby rh » Mon Feb 20, 2017 9:18 pm

Seems like a good place to share this. I don't use Regex enough to become very proficient, let alone master it. Recently I came across the free (with registration) tool below and I've used it a few times to test RE's that I use with NB. Took a tiny bit of time getting the hang of it and I hardly use its full potential, but It's real handy.

http://www.ultrapico.com/Expresso.htm
rh
Seasoned User
Seasoned User
 
Posts: 301
Joined: Sat Nov 27, 2004 4:02 pm

Registered Newsbin User since: 11/27/04

Re: Cheat Sheet

Postby dexter » Tue Feb 21, 2017 7:27 pm

Nice, good find.
User avatar
dexter
Site Admin
Site Admin
 
Posts: 9514
Joined: Fri May 18, 2001 3:50 pm
Location: Northern Virginia, US

Registered Newsbin User since: 10/24/97


Return to Regular Expressions

Who is online

Users browsing this forum: No registered users and 4 guests