text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
comes with a few built-in variables so
3,491.24
4.16
to speak things that you can think of as
3,493.48
5.72
constants that have meaning to re.
3,495.4
6.639
search and they do so as follows if you
3,499.2
5.68
pass in as a flag re. ignore case what
3,502.039
4.961
re. search is going to do is ignore the
3,504.88
3.88
case of the user's input it can be
3,507
3.319
uppercase lower case a combination
3,508.76
3.52
thereof the case is going to be ignored
3,510.319
4.201
it will be treated case insensitively
3,512.28
3.519
and you can do other things too that we
3,514.52
3.279
won't do here but if you want to handle
3,515.799
3.8
the user's input that maybe spans
3,517.799
3.56
multiple lines maybe they didn't just
3,519.599
3.76
type in an email address but an entire
3,521.359
4.081
paragraph of text and you want to match
3,523.359
3.801
different lines of that text that is
3,525.44
4.639
multiple lines another flag is for re.
3,527.16
5.72
multi-line for just that or re doall
3,530.079
5.081
whereby you can con uh you can configure
3,532.88
5.36
the DOT to rep to recognize not just any
3,535.16
5.439
character except new lines but any
3,538.24
4.839
character plus new lines as well but for
3,540.599
4.24
now let me go ahead and just make use of
3,543.079
3.841
this first one let me pass in a third
3,544.839
5.361
argument to re. search which is
3,546.92
7.439
re. uh ignore case let me now rerun the
3,550.2
5.839
program without clearing my screen
3,554.359
4
python of validate dopy let me type in
3,556.039
4.681
again in all caps effectively shouting
3,558.359
5.841
maen harvard.edu enter and now it's
3,560.72
5.92
considered valid because I'm telling re.
3,564.2
4.359
search specifically to ignore the case
3,566.64
4.24
of the input and that to here is fine
3,568.559
3.961
and why might I do this approach rather
3,570.88
3.8
than call do lower in one of those other
3,572.52
4.12
locations if I don't actually want to
3,574.68
3.76
change the user's input for whatever
3,576.64
3.84
reason I can still treat it case
3,578.44
4.8
insensitively without actually changing
3,580.48
5.76
the value of that variable itself all
3,583.24
5.119
right any final questions now on this
3,586.24
4.24
validation of email
3,588.359
5.881
addresses uh so the pattern is a string
3,590.48
8
right M uh can use an F string you can
3,594.24
6
yes you can use an F string so that you
3,598.48
3.879
could plug in for instance the value of
3,600.24
4.64
a variable and pass it into the function
3,602.359
4.921
other questions on this access W
3,604.88
4.52
character could we take it as an input
3,607.28
4.48
from the user technically yes that's not
3,609.4
3.8
a problem we're trying to solve right
3,611.76
3.279
now we want the user to provide literal
3,613.2
3.599
input like their email address not
3,615.039
4.241
necessarily a regular expression but you
3,616.799
4.161
could imagine building software that
3,619.28
3.44
asks the user especially if they're more
3,620.96
3.44
advanced users to type in a regular
3,622.72
3.92
expression for some reason to validate
3,624.4
3.76
something else against that and in fact
3,626.64
3.439
that's what Google's doing if you play
3,628.16
3.72
around with Google forms and create a
3,630.079
4.24
form with response validation and select
3,631.88
5.36
regular expression Google lets you and I
3,634.319
4.641
type in our own regular Expressions
3,637.24
3.16
would be a per which would be a perfect
3,638.96
3.44
example of that all right well let me
3,640.4
4.36
propose that we try to solve one other
3,642.4
5.56
problem here whereby if I go into the
3,644.76
5.72
same version as before which is now
3,647.96
4.599
ignoring case but I type in one of my
3,650.48
3.92
other email addresses let me go ahead
3,652.559
4.441
and run python of validate and this time
3,654.4
4.76
let me type in not maen harvard.edu
3,657
4.24
which I use primarily but my another
3,659.16
4.28
email address of mine maen cs50.h
3,661.24
4.92
harvard.edu which forwards to the same
3,663.44
5.08
let me go ahead and hit enter now and
3,666.16
5.48
huh invalid even though I'm pretty sure
3,668.52
4.88
that is in fact my email address well
3,671.64
4.32
let's put our finger on the reason why
3,673.4
5.919
why at the moment is mail at cs50.h
3,675.96
6.879
harvard.edu being considered invalid
3,679.319
6.04
even though I'm pretty sure I send and
3,682.839
6.121
receive email email from that address
3,685.359
3.601
too why might that be because there is a
3,689.599
9.121
DOT that has come after the ad symbol
3,693.48
9
exactly there's a DOT after my cs50 and
3,698.72
5.52
I'm not expecting any dots there I'm
3,702.48
4.119
expecting only again word characters
3,704.24
5.92
which is a through z 0-9 and underscore
3,706.599
5.881
so I'm going to have to retool here but
3,710.16
4.04
how could I go about doing this well it
3,712.48
4.04
turns out theoretically there could be
3,714.2
3.839
other email addresses even though they'd
3,716.52
3.4
be getting a little excessively long for
3,718.039
4.881
instance mailin at something. cs50.h
3,719.92
4.84
harvard.edu which is not technically
3,722.92
4.119
exist but it could you can have of
3,724.76
4.2
course multiple dots in a domain name
3,727.039
3.76