tags:

views:

60

answers:

4

I always get confused using regular expressions. Can anyone please suggest me a tutorial?

I need help with checking for a string which,

cannot contain any wild characters except colon, comma, full stop.

It will be better to replace these if found.

Any help?

Thanks.

A: 

I personally printed this cheatsheet and put it on my desk. Helps a lot.

Also, this tutorial seems to be decent.

Ondrej Slinták
+5  A: 

Check out http://www.regular-expressions.info/

gms8994
Same site I used to learn regex. Practice is the key.
Alex Larzelere
A good well-rounded resource.
Kris Kumler
+1 for this, was the first regex site I ever found on the web
soulBit
A: 

Two things:

  • Bookmark regular-expressions.info, and read the whole tutorial first.
    • Refer to that page whenever you're in doubt.
  • Install Expresso, and write and analyze your regex there

I learned regex by answering questions on SO. Find the latest regex question, minimize the browser and solve it on your favorite language, come back and compare. Feel free to ask the answerers for explanations if you feel like, they'll be happy to. Once you're partially confident, start posting your solutions. Regex tag is so popular that you'll get a feedback within minutes. Make your mistakes and learn from them. All the best!

Amarghosh
+1  A: 

I recommend this flash tool that allows you to build and test regular expressions - it has most of the features that are common in the desktop programs you pay for!

soulBit
That is so f***ing cool. +1!
Cam
Glad you liked it, it has really helped me figure out some silly errors in my regex's before :)
soulBit