Regular expressions are extremely useful in extracting information from text such as code, log files, spreadsheets, or even documents. And while there is a lot of theory behind formal languages, the following lessons and examples will explore the more practical uses of regular expressions so that you can use them as quickly as possible.

If you have no regular expressions experience at all; this is where to start: regexone.com

If you want to see how it is used in python

Also, this cool online tool would generate the regex script for you.

FYI, regex syntax is different between Python, Perl, Java and vim. So here is a cheatsheet that has the most common regex syntax across different platforms: regex cheatsheet