🐍 Learn Python with Google | Regular Expressions  | Video Log - Week 7
Channel: Fabio Pacifici
Date: 05/04/2020

This is the week seven of my video log learn Python with google.
This week was quite hard, and I didn't move much forward as the topic we studied is quite complicated.

Early this week, I started the Third module of the course Using Python to interact with the
operative system. We studied regular expressions in Python using their python module.

This module is included in the standard python library, so no installation as 
we only needed to import it.

We started with an introduction to the basics of regular expressions, 
what they are, and why use them. 
A regular expression is a search query for text.
And we use a string pattern to search in the text.
It offers better flexibility over the index() method on strings to find a specific 
pattern.

After covering the basic theory, we imported the module and 
worked on a few simple regular expressions using the 
search() method.

We covered briefly also how to use regex with command-line tools 
like grep, and we studied some of the regex reserved characters:
- the dot (wildcard - represent any single character)
- the caret (returns words starting with a given pattern)
- the dollar sign (returns words ending with a given pattern )

Al the end of the first section, of course, the module
there was a two questions quiz that I passed and moved
forward to the next section.

In the second section, we studied the basics of regex.
Here we did lots of practice and examples as well as 
studied most of the reserved characters and functions 
that comes with the re module.

We started using the search() method and raw string search patters consistently. We created lots of scripts to practice and used the reserved characters, including the dot, caret, the dollar sign to perform a different
search query. 

Then we studied the character classes, how to define a range, 
how to use the caret inside a character class to search 
characters not in a group. We used the pipe character to 
define multiple values for our search patter, and studied how to
return all matches using the method findall().

Often during the episodes, there is a question and a code 
to complete before moving forward.

We have then learnt how to use repetition qualifies to find repeated matches.
We studied the star, plus and question mark qualifiers and how to
use them with practical examples. 
Essentially here:
- the star qualifier matches all characters until the character that comes after it.
- the plus matches one or more occurrences of the character that comes before it.
- while the question mark returns one or zero occurrences of the character before it.

Also, during this episode of the course, there was a quick coding-challenge before moving to the next video.

Next, we studied how to escape characters using different approaches. 
We have learnt how to use the backslash to escape any special character.
How to use \w to escape alphanumeric characters
how to use \d for digits
how to use \s to escape whitespaces, including tabs or newlines.
And how to use \b for word boundaries.

Then the usual coding challenge of the episode and moved
forward to see regex in action with more practical 
examples and coding challenges.

At the end of this section a two question coding challenge 
before moving forward to the next and last part of the module: advanced regex.

In the final section of the course 
we studied some advanced concepts and wrote more regex expressions.

This section started covering the capturing groups concept and worked more on repetition qualifiers. We used numeric
repetition qualifiers and wrote more scripts to practice 
with these concepts.

We then studied two methods of the re module,
the split() and sub() modules.

Also, in this section of the course, there was a coding
challenge in the middle of the video, then a final practice quiz
with two questions. 

I passed all practice quiz with 100% of score. Now the module is complete. I am holding on before doing the final graded assessment
of this module as I know, it will be challenging, so I took a quick break.

I will probably start the graded assessment tomorrow or maybe tonight if I don't feel tired.

# Finally, yesterday, I have recorded the fifth episode of the python course for beginners (in Italian) as part of the
on my consolidation plan for this Python journey. 
This week I managed to do only one video as I was busy.

# Before the end of the next week,
I plan to either complete the graded assessment but also start the fourth module 
of the google python course and probably record the final video of my python course for beginners that will be the sixth.

I will keep working on the consolidation 
plan, as well as do some coding challenges on hackerank.
That's it for this week. I'll see you next week for another episode of my 
learn Python with google video log.

As always, 
STAY HOME, PROTECT YOUR FAMILY AND SAVE YOUR ASS.

🤓 Read more about the certification here: 
https://fabiopacifici.com/learn-python-google-it-automation-with-python/