Python Regular Expressions - Computerphile

preview_player
Показать описание
Continuing the exploration of Regular Expressions and Automata with Professor Thorsten Altenkirch.

This video was filmed and edited by Sean Riley.

Рекомендации по теме
Комментарии
Автор

The way in which Prof Altenkirsch talks during this video is almost indistinguishable from the conversation a lone programmer would have with himself out loud during an intense programming session. If anyone ever wondered what programmers sound like when there's no-one to hear them code, this is pretty much it.

mokopa
Автор

It never came to me that the highest level of Pythonic is to lean back 40 degrees with your upper body while writing Python.

RagHelen
Автор

So this is not an explanation of Regular Expressions as a tool, that we might use on a daily basis. This is the theoretical basis for how REs is implemented. It's stuff covered in undergrad CS, and one of the next lessons is making your own parser for your own programming language.

jens
Автор

The amount of times he wrote return as retrun makes this video super relatable and gives me hope

jackerylel
Автор

I love watching this guy, he looks like some kind of ancient sage like a programming Gandalf

frederico-kluser
Автор

This feels like they edited a 2 hour video, which explained everything, down to 20 minutes :-)

BigJonYT
Автор

I love Thorsten. ❤❤ the guy is a true genius of our time.

YuTv
Автор

Another video with Thorsten? Awesome! He has a great sense of humor.

Erik_The_Viking
Автор

Just watching because of Prof. Altenkirch

MangoNutella
Автор

Right back to it, I see! There's an error in the example with the alternating as and bs at 0:59. It should not have a "+" (meaning or) in between "(ab)*" and "(a+ε)"

ivarkrabol
Автор

Please change the title of this video. Python is not the important part. People are going to search for help with using regular expressions in Python (import re) and find this video which is not going to help.

djhoese
Автор

thank you so much for this serie linking automatons to regexes!

pouet
Автор

I've always focused on just getting the re to serve some purpose. That's why I got an engineering degree, not a mathematics degree. But this helps me appreciate just how much math is under the hood (bonnet?)! It's fun listening to prof Altenkirsh even though the machine code episode was more my speed

arthurdent
Автор

Halfway through and I don't understand what's happening...
What's the point? Why Python is important for this?

IIARROWS
Автор

I think Sean has gotten free university degree from making these videos. I hope he gets his diploma at some point

velho
Автор

It would have saved me a lot of time if the mystery regex had been shown correctly on the screen and the paper (from 20:38). The correct regex (with sensible symbols) is /(0|11|10(00|1)*01)*/.
After I had wasted much time on the incorrect one, I drew the AST from the python code in a notebook since I didn't trust the comment above it. The comment was correct as it turned out.

Here's the first matches:
0 : 0
11 : 3 (11)
110 : 6 (11 0)
1001 : 9 (10 01)
1100 : 12 (11 0 0)
1111 : 15 (11 11)
10010 : 18 (10 01 0)
10101 : 21 (10 1 01)
11000 : 24 (11 0 0 0)
11011 : 27 (11 0 11)
11110 : 30 (11 11 0)

I think I can see the pattern.

phizc
Автор

The RE at the end seems to detect binary numbers that are multiple of 3. However, I'm not sure how it checks this.

zamf
Автор

great series! i really liked the implementation style

yedidiapery
Автор

Unit testing should also know the expected result. There should be some instant feedback instead of someone checking and saying, "Yep, that test case must return false, so it's okay".

syjwg
Автор

What makes this project particular to "Python" Regular Expressions? Cause re exists and you could roll your own regex in most languages.

Aren't you just making regexes (in some language, that happens to be python)?

pylang