text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
names even though they tend to use just
7,297.88
4.4
this one suppose they have uh something
7,299.92
4.52
like.org as well you could use more
7,302.28
3.52
parentheses here and do something like
7,304.44
4.4
this Comm or org I'd probably want to go
7,305.8
5.12
in and add a question mark colon to make
7,308.84
3.96
it non-capture because I don't care
7,310.92
4.92
which it is I just want to tolerate both
7,312.8
5.52
alternatively we could capture that we
7,315.84
4.319
could do something like this where we do
7,318.32
5.24
do plus so as to actually capture that
7,320.159
5.52
and then we could do something like this
7,323.56
7.72
if matches. group one now equals equals
7,325.679
8.081
Comm then we could support this so you
7,331.28
4.839
could imagine factoring out the logic
7,333.76
4.479
just by extracting the top level domain
7,336.119
4.441
or TLD and then just using python code
7,338.239
4
maybe a list maybe a dictionary to
7,340.56
4.44
validate elsewhere outside of the redx
7,342.239
5.081
if it's in fact what you expect for now
7,345
4.28
though we kept things simple we focused
7,347.32
4.879
only on the Doom in this case let's make
7,349.28
4.6
one final change to this program so that
7,352.199
3.241
we're being a little more specific with
7,353.88
3.799
the definition of a Twitter username it
7,355.44
3.719
turns out that we're being a little too
7,357.679
3.281
generous over here whereby we're
7,359.159
4.161
accepting one or more of any character I
7,360.96
4.32
check the documentation for Twitter and
7,363.32
3.839
Twitter only supports letters of the
7,365.28
5.72
alphabet A through Z numbers 0-9 or
7,367.159
6.44
underscores so not just dot which is
7,371
4.92
literally anything so let me go ahead
7,373.599
4.12
and be more precise here at the end of
7,375.92
5
my string let me go ahead and say this
7,377.719
5.801
set of symbols in square brackets I'm
7,380.92
4.92
going to go ahead and say a through z uh
7,383.52
4.88
0 through 9 and an underscore because
7,385.84
4.279
again those are the only valid symbols I
7,388.4
3.36
don't need to bother with an uppercase a
7,390.119
4.361
or a lowercase z because we're using re.
7,391.76
5.08
ignore case over here but I want to make
7,394.48
4.84
sure now that I tolerate not only one or
7,396.84
5.12
more of these symbols here but also
7,399.32
4.319
maybe some other stuff at the end of the
7,401.96
3.56
URL I'm now going to be okay with there
7,403.639
4.281
being a slash or a question mark or a
7,405.52
4.44
hash at the end of the URL all of which
7,407.92
4.52
are valid symbols in a URL but I know
7,409.96
4.92
from the Twitter's documentation are not
7,412.44
4.719
part of the username all right now I'm
7,414.88
3.719
going to go ahead and run python of
7,417.159
5.241
twitter. one final time typing in
7,418.599
5.56
HTTPS
7,422.4
4.679
twitter.com davidj ma maybe with maybe
7,424.159
4.881
without a trailing slash but hopefully
7,427.079
3.961
with my biggest fingers crossed here I'm
7,429.04
4.519
going to go ahead now and hit enter and
7,431.04
5.039
thankfully my username is indeed David J
7,433.559
4.801
Ma so what more is there in the world of
7,436.079
4.241
regular expressions and this own Library
7,438.36
4.359
not just re. search and also re.sub
7,440.32
4.64
there's other functions too there's re
7,442.719
4.761
dosit via which you can split a string
7,444.96
4.48
not using a specific character or
7,447.48
4.36
characters like a comma and a space but
7,449.44
5
multiple characters as well and there's
7,451.84
4.799
even functions like re. findall which
7,454.44
4.679
can allow you to search for multiple
7,456.639
4.321
copies of the same pattern in different
7,459.119
3.761
places in a Str so that you can perhaps
7,460.96
4.48
and manipulate more than just one so at
7,462.88
4
the end of the day now you've really
7,465.44
3.799
learned a whole other language like that
7,466.88
4.08
of regular expressions and we've used
7,469.239
3
them in Python but these regular
7,470.96
3.719
Expressions actually exist in so many
7,472.239
5
languages too among them JavaScript and
7,474.679
5.44
Java and Ruby and more so with this new
7,477.239
4.681
language even though it's admittedly
7,480.119
3.321
cryptic when you use it for the first
7,481.92
3.239
time you have this new found ability to
7,483.44
3.639
express these patterns that again you
7,485.159
4.4
can use to validate data to clean up
7,487.079
5.441
data or even extract data and from any
7,489.559
5.241
data set you might have in mind that's
7,492.52
4.48
it for this week we will see you next
7,494.8
5.2
time
7,497
3
[MUSIC PLAYING]
0.499
3.704
SPEAKER 1: All right.
15.844
0.956
So this is CS50.
16.8
1.8
And this is the start of week 3.
18.6
1.81
And you'll recall that last time, we introduced a number of new ideas
20.41
3.23
that we'll now start taking for granted as being already under our belt.
23.64
3.48
In particular, we looked last time at debugging more generally.
27.12
3.47
And recall that debugging is the process of removing bugs from your code,
30.59
3.11
removing mistakes from your code.
33.7
1.69
And we proposed these three CS50-specific tools.
35.39
3.34
In particular, help50, which is a command line tool.
38.73
2.589
Something that you can run at your keyboard
41.319
1.791