Sample Regular Expressions

2005 June 9
by MeanDean

Neex an example of a regular expression real quick? Want to test it without fouling up your code? Here are two ‘resource-filled’ sites that help get you there and back.

Busy, busy, busy today folks - so just a quicky. And yes, I know that I’ve mentioned at least one of the following regular-expression example (and test) sites I’ve before. That said, like a good burrito it bears repeating:

  • Regular Expression Library - this website claims to be “the Internet’s first Regular Expression Library.” Whether they are or not is irrelevant, what is relevant are the close to 1000 semi-documented regex examples they provide.
  • Regular-Expressions.Info - also blessed with examples, I’m partial to their javascript testing page - and find their detailed explanations of difficult expressions well worth the visit.
  • Perl : Sample Regular Expressions - nothing as comprehensive as the previous two links, but here are some nice simple examples of the type of one-line-wonder stuff you may want to add into a MovableType or WordPress plug-in or text filter.

Now you have no excuse not to shoot yourself in the foot with a nice nasty regex!

2 Comments leave one →
2005 June 9

Great resources, thanks!

2005 June 12
Dan Dombrowsky permalink

If you’re really into regex, I would suggest a good program to help you build, test, and implement your regex code:

http://www.regexbuddy.com/

It also has a code creator feature to port your regex into whatever language you need.

Leave A Comment

You must be logged in to post a comment.