1
00:00:00,000 --> 00:00:04,990
Regular expressions are a very powerful method for matching patterns in text.

2
00:00:05,000 --> 00:00:08,990
Regular expressions are used for a variety of purposes, from simple search and

3
00:00:09,000 --> 00:00:14,990
replace operations to complex text and data file manipulation.

4
00:00:15,000 --> 00:00:16,990
Regular expressions are actually a small language in itself.

5
00:00:17,000 --> 00:00:21,990
Regular expressions can be very simple or they can be very complex.

6
00:00:22,000 --> 00:00:25,990
Entire books have been written on the subject of regular expressions.

7
00:00:26,000 --> 00:00:28,990
If you are moderately familiar with how they work and what they look like,

8
00:00:29,000 --> 00:00:32,990
you can get a lot of power out of them using Python's regular expression module.

9
00:00:33,000 --> 00:00:37,990
Regular expressions are implemented in Python with the re module.

10
00:00:38,000 --> 00:00:41,990
This is Python's regular expression module and it's distributed with Python.

11
00:00:42,000 --> 00:00:44,990
So if you have Python, you have the re module.

12
00:00:45,000 --> 00:00:47,990
How it works looks like this.

13
00:00:48,000 --> 00:00:53,990
You import re and you compile a pattern and then you use the pattern to search

14
00:00:54,000 --> 00:00:56,990
and replace or to perform whatever manipulations you are going to perform using

15
00:00:57,000 --> 00:00:58,990
the regular expressions.

16
00:00:59,000 --> 00:01:09,000
So let's go ahead and look at how we use regular expressions in Python.

