Regular expressions are very useful tool, and there are a lot of situations, when programmer should use them. You shouldn't learn them all by heart to use. Just use reference and do your task. After 10-20-50-100(depending on the programmer) tasks where you have used regular expressions, you will know them all by heart. They are being learned by themselves, you shouldn't learn them specially.