Regular Expression in Python

'How to learn regular expression in Python?' - a very common question from the beginners or Python newbies. Well... if you can use regular expression in Perl or PHP, then it's not very different in Python.

And if you are completely new to regular expression and want to learn it, then you can follow the following guideline:

[Update on Oct 30, 2010]: I think you should start with this video on regular expression.

At first, you should be to read Regular Expression HowTo by A.M. Kuchling. Read it carefully and read it at least twice :)

So... now you have finished reading Regular Expression How To and still not very confident. Don't worry. It's time to dive into regular expression. Just go through Chapter 7 Regular Expressions of Dive Into Python. Don't forget to code each and every example. There are some nice case studies. Those will help (it was really helpful in my case).

And now it's time for you to check details about the re module from python doc.

By this time you should be a good player of regular expressions and can use it to solve practical problems.

Still want to be a master? Then you should read this: Mastering Regular Expressions (I haven't read it yet though ;)

If you have to work with regular expressions frequently, you can check this one: Regular Expression Pocket Reference: Regular Expressions for Perl, Ruby, PHP, Python, C, Java and .NET (Pocket Reference (O'Reilly))

Hopefully learning regular expressions will empower you more!

Comments

Anonymous said…
Thanks for some interesting links!
"Regular Expression HOWTO" - I've never see it before this.
Tamim Shahriar said…
Its my pleasure to know you liked it :)
i like the name of you blog ;)
i like the name of you blog ;)

Popular posts from this blog

Strip HTML tags using Python

lambda magic to find prime numbers

Convert text to ASCII and ASCII to text - Python code