text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
question mark it also won't work so a
5,867.679
4.48
lot of scenario actually oh my God I
5,870.4
3.839
mean here we are I pretending to think I
5,872.159
3.721
was done but my God like Alex gave us a
5,874.239
3.721
whole laundry list of like problems and
5,875.88
3.799
just to recap then what if it's not
5,877.96
4.92
https it's HTTP slightly less secure but
5,879.679
5
I should still be able to tolerate that
5,882.88
3.68
programmatically uh what if the protocol
5,884.679
3.241
is not there what if the user just type
5,886.56
3.52
twitter.com davidj mailin it would be
5,887.92
4.12
nice to tolerate that rather than show
5,890.08
3.519
an error and make me type in the
5,892.04
3.36
protocol why it's not good user
5,893.599
4.321
experience what if it had a slash at the
5,895.4
4.64
end of the username or a question mark
5,897.92
3.84
If you think about URLs you've seen on
5,900.04
3.8
the web there's very commonly more
5,901.76
3.479
information especially if it's been
5,903.84
3
shared on social media there might be
5,905.239
4
HTTP parameters so to speak just stuff
5,906.84
3.759
there that we don't want there could be
5,909.239
2.601
a
5,910.599
3.281
www.twitter.com which I'm also not
5,911.84
3.96
expecting but does work if you go to
5,913.88
4.48
that URL too so there's just so many
5,915.8
4.319
things that can go wrong and even if I
5,918.36
3.96
come back to my contrived example as
5,920.119
4.161
earlier what if I run this program and
5,922.32
5.76
say this uh my username is
5,924.28
5.359
https
5,928.08
6.039
twitter.com davidj mailen enter well
5,929.639
7.48
that too just just didn't really work it
5,934.119
5.12
got rid of the U
5,937.119
4
actually okay actually that kind of
5,939.239
4.761
worked but the goal here is to actually
5,941.119
4.961
get the user's username not an English
5,944
4.159
sentence describing the user's username
5,946.08
4.119
so I would argue that even though I just
5,948.159
3.721
accidentally created perfectly correct
5,950.199
4.201
English grammar I did not extract the
5,951.88
4.52
Twitter username correctly I don't want
5,954.4
4.839
words like my username is as part of my
5,956.4
5.08
input so how can we go about improving
5,959.239
3.92
this and maybe chipping away at some of
5,961.48
3.239
those problems one by one well let me
5,963.159
3.681
clear my screen here let me come back up
5,964.719
4.641
to my code and let me not just replace
5,966.84
4.799
it but let me do something else instead
5,969.36
3.839
I'm going to go ahead and instead of
5,971.639
3.241
using replace I'm going to use another
5,973.199
4.601
function called remove prefix a prefix
5,974.88
5.44
is a string or a subring that comes at
5,977.8
5.2
the start of another so if I remove
5,980.32
4.279
prefix I don't need a second argument
5,983
3.76
for this function I just need one what
5,984.599
4.281
prefix do you want to remove so this
5,986.76
4.879
will at least now fix the problem I just
5,988.88
4.759
described of typing in like a whole sent
5,991.639
3.96
where the URL is there but it's not the
5,993.639
4.841
beginning it's only at the end so here
5,995.599
4.801
this still is not correct but we don't
5,998.48
3.759
create this weird looking output that
6,000.4
4.839
just removes the URL part of the input
6,002.239
5.761
uh my username is
6,005.239
6.601
htps twitter.com davidj maen a moment
6,008
7.4
ago it did remove the URL and left only
6,011.84
6.08
the David J ma this is not perfect still
6,015.4
4.96
but at least now it does not weirdly
6,017.92
4.52
remove the URL and then leave the
6,020.36
4.4
English it's just leaving it alone so
6,022.44
3.84
maybe I could handle this better but at
6,024.76
3.399
least it's removing it from the part of
6,026.28
3.56
the string I might
6,028.159
3.921
anticipate well what else could we do
6,029.84
4.12
here well it turns out that like regular
6,032.08
4.639
Expressions just let us express patterns
6,033.96
4.8
much more precisely we could spend all
6,036.719
3.52
day using a whole bunch of different
6,038.76
3.52
python functions like remove prefix or
6,040.239
4.561
remove and strip and others and kind of
6,042.28
5.359
make our way to the right solution but a
6,044.8
4.48
regular expression just allows you to
6,047.639
3.681
more succinctly if admittedly more
6,049.28
4.6
cryptically Express these kinds of
6,051.32
4.56
patterns and goals and we've seen from
6,053.88
4
parentheses which can be used not just
6,055.88
4.92
to group symbols together as sets but to
6,057.88
5.359
capture information as well we have a
6,060.8
5.919
very powerful tool now in our toolkit so
6,063.239
6.161
let me do this let me go ahead and start
6,066.719
6
fresh here and import the re Library as
6,069.4
5.08
before at the very top of my program I'm
6,072.719
3.92
still going to get the user's URL via
6,074.48
4.04
the same line of code but I'm now going
6,076.639
4.761
to use another function as well it turns
6,078.52
5.28
out that there's not just re do search
6,081.4
4.88
or rd. match or re. full match there's
6,083.8
5.879
also re. sub in the regular expression
6,086.28
5.839
Library where sub here means substitute
6,089.679
4.241