- [Instructor] In this and the next several videos,
we're going to take a look at
regular expression processing in Python.
If you're not familiar with regular expressions,
they are generally used for matching patterns within text
and once you've matched those patterns,
you typically are going to use the results
to do things like validate data,
making sure that it's in the right format,
cleaning up data to prepare to use it in your code,
scraping data to extract information.
For example, you might want to get hashtags
out of social media posts
and sometimes you'll use them for transforming data as well.
Now rarely do you ever have to create
your own regular expressions nowadays
because there are these tremendous repositories out there
that catalog regular expressions
and help you find what you need.
So these are just a few of the repositories that I've used
and there are many more out there as well.
So if you find the need to use
the techniques that I'm about to show you
and you have a particular pattern you're looking to match,
I would go take a look at the repositories first,
and one of the great things about iPython
and the interactive mode is that
it's really easy to go ahead and work
with regular expressions and test them out
so that you can see if they perform
the tasks that you need in your code.