There are three stages of knowing regex.

The first stage, is when you just hear it for the first time. It sounds cool and awesome. It also sounds like its a powerful tool.

The second stage, is when you try it out for the first time, and you are still in awe. All those hours wasted in editing large text documents… could have been utilised better. This stage lasts anywhere from a few hours to few days.

The third stage, is where you become a condescending know-it-all. When someone, who is in the second stage, mentions regex to you, you act like… well… a condescending know-it-all. This stage typically lasts for months, or even years. Some people may never get to the fourth stage.

The fourth stage, is when you appreciate it for what it is. You don’t compare it, and you don’t judge it. If you are lucky, you will make it here.

Warning : If you are in the third stage, stop reading this post right now.

Maybe I shouldn’t rip-off xkcd too much. I’ll search for more webcomics using the regex of internet : bing.

Basically, regex allows you to search and replace patterns. Its a powerful tool, but a specialised tool - Not for everyday use.

How to use regex?

  • grep command
  • sublime text editor
  • python regex module

Where to learn regex?