text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
notice the now familiar symbols there is
4,235.48
5.32
the carrot symbol at the very top there
4,238.44
5
is the dollar sign at the very end there
4,240.8
4.64
is a square bracket over here and then
4,243.44
3.84
some of these ranges plus other
4,245.44
3.84
characters turns out you don't normally
4,247.28
3.879
see these characters in email addresses
4,249.28
3.399
it looks like you're swearing at someone
4,251.159
3.601
in their username but they're valid
4,252.679
4.081
characters they're valid officially that
4,254.76
3.479
doesn't mean that Gmail is going to
4,256.76
4
allow you to put dollar signs and other
4,258.239
4.241
punctuation in your username but
4,260.76
4.08
officially some servers might allow that
4,262.48
4.36
so if you really want to validate a
4,264.84
4.16
user's email address you would actually
4,266.84
4.56
come up with or copy paste something
4,269
5
like this but honestly this looks so
4,271.4
4.4
cryptic and if you were to type it out
4,274
3.96
manually you are so likely to make a
4,275.8
4.399
mistake what's the better solution here
4,277.96
5.239
instead this is where P past week's
4,280.199
5.641
libraries are your friend sure someone
4,283.199
5.121
else on the internet a programmer more
4,285.84
4.839
experienced than you even has come up
4,288.32
5.12
with code that validates email addresses
4,290.679
4.681
properly using this regular expression
4,293.44
3.52
or even something more sophisticated
4,295.36
3.52
than that so generally if the problem at
4,296.96
4.4
hand is to validate input that is pretty
4,298.88
4.96
conventional an email address a URL
4,301.36
3.839
something where there's an official
4,303.84
3.799
definition that's independent of you
4,305.199
5.241
yourself find a popular library that
4,307.639
5.281
you're comfortable using and use it in
4,310.44
4.56
your code to validate email addresses
4,312.92
4.64
this is not a wheel necessarily that you
4,315
4.719
yourself should invent we've used email
4,317.56
4.2
addresses though to iteratively start
4,319.719
4.081
from something simple too simple and
4,321.76
3.919
build on top of that so you could
4,323.8
3.399
certainly imagine using regular
4,325.679
2.921
Expressions still to validate things
4,327.199
3.52
that aren't email addresses but are data
4,328.6
4.599
that are important to you so we at least
4,330.719
4.721
now have these building blocks now
4,333.199
3.801
besides the regular Expressions
4,335.44
2.96
themselves it turns out there's other
4,337
3.88
functions in Python's re library for
4,338.4
4.36
regular Expressions among them is this
4,340.88
3.68
function here re. match which is
4,342.76
4.28
actually very similar to re. search
4,344.56
4.24
except you don't have to specify the
4,347.04
3.32
carrot symbol at the very beginning of
4,348.8
3.28
your Rex if you want to match from the
4,350.36
4.6
start of a string re. match by Design
4,352.08
4.96
will automatically start matching from
4,354.96
3.96
the start of the string for you similar
4,357.04
4.28
in spirit is re. full match which does
4,358.92
4.12
the same thing but not only matches at
4,361.32
3.2
the start of the string but the end of
4,363.04
3.32
the string so that you too don't need to
4,364.52
4.24
type in the carrot symbol or the dollar
4,366.36
4.64
sign as well but let's go ahead and
4,368.76
4.32
transition back now to some actual code
4,371
3.76
whereby we solve a different problem in
4,373.08
3.88
spirit rather than just validate the
4,374.76
4.04
user's input and make sure it looks the
4,376.96
3.84
way we want let's just assume that the
4,378.8
3.879
users are not going to type in data
4,380.8
3.839
exactly as we want and so we're going to
4,382.679
3.801
have to clean up their input this
4,384.639
3.641
happens so often when you're using like
4,386.48
4.28
a Google form or Office 365 form or
4,388.28
4.72
anything else to collect user input no
4,390.76
4.56
matter what your form question says your
4,393
4.12
users are not necessarily going to
4,395.32
3.48
follow those directions they might go
4,397.12
3.079
ahead and type in something that's a
4,398.8
3.32
little differently formatted than you
4,400.199
3.921
might like now you could certainly go
4,402.12
4.64
through the results and download a CSV
4,404.12
4.36
or open the Google spreadsheet or
4,406.76
3.76
equivalent in Excel and just clean up
4,408.48
4.12
all the data manually but if you've got
4,410.52
4.199
lots of submissions dozens hundreds
4,412.6
4.76
thousands of rows in your data set doing
4,414.719
4.48
things manually might not be very fun it
4,417.36
3.56
might be much more effective to write
4,419.199
4.52
code as in Python that can allow you to
4,420.92
5.44
clean up that data and any future data
4,423.719
5.841
as well so let me propose that we go
4,426.36
5.359
ahead here and close validate dopy and
4,429.56
3.88
let's go ahead and create a new program
4,431.719
4.041
alog together called format. Pi the goal
4,433.44
4.68
of which is to reformat the user's input
4,435.76
4.64
in the format we expect I'm going to go
4,438.12
5.28
ahead and run code of format. piy and
4,440.4
4.759
let's suppose that the data we're going
4,443.4
4.56
to reformat is the user's name so not
4,445.159
5.04