CS50P - Lecture 7 - Regular Expressions

Поделиться
HTML-код
  • Опубликовано: 2 дек 2024

Комментарии • 180

  • @xavier2586
    @xavier2586 2 года назад +256

    I said it before and I'll say it again, I'll never forget this man in my whole lifetime.

    • @davidjmalan
      @davidjmalan 2 года назад +75

      Thank you, Xavier!

    • @chorakdoon6658
      @chorakdoon6658 10 месяцев назад +15

      Why does this sound sweet and threatening at the same time 😂

  • @kingofcastlechaos
    @kingofcastlechaos Год назад +75

    I have often used the phrase "Let me propose....." during large gatherings and it is like a dog whistle for finding my CS50 peeps in a crowd. Their heads whip around and our eyes connect and we share a smile. Thank you Professor Malin for all you have done for us. Your contribution to the world will never be fully quantified.

    • @crysre
      @crysre 4 месяца назад

      *Malan

    • @josket821
      @josket821 4 месяца назад +2

      ​@@crysre you had to ruin

    • @crysre
      @crysre 4 месяца назад

      @@josket821 haha, it's the way life works man

    • @toke7342
      @toke7342 Месяц назад

      *Malan

  • @seraphim9219
    @seraphim9219 2 года назад +378

    david i'm gonna need to put a backslash before you, bc you're a special character to me ;)

  • @Caravanseraii
    @Caravanseraii 4 месяца назад +12

    I like the professor's way of speaking.Very articulate and precise.

  • @Terrysophia-lg3oe
    @Terrysophia-lg3oe Год назад +46

    I never thought regular expressions could be fun until I watched this lecture. Thank so much!

  • @Drop_The_Mic
    @Drop_The_Mic 2 года назад +126

    David J. Malan, Sir you are a great role model for all lecturers. you put a lot of effort into teaching and making the class fun. I hope all lecturers are like you.

    • @davidjmalan
      @davidjmalan 2 года назад +38

      Thanks for the kind words!

    • @bcak611
      @bcak611 2 года назад +1

      He is a lecturer, from Harvard! xD

    • @williamenur3404
      @williamenur3404 2 года назад +2

      @@davidjmalan You are the best teacher i’ve ever seen

    • @its_me_tabs
      @its_me_tabs Год назад +2

      @Drop_The_Mic if you are a lecturer and you put in the work to improve your game as a lecturer, I want to specifically say hats off to you too for that! As a student, I have witnessed lecturers who are too proud to learn and yet they are not doing so well, and thus never improve. They will continue to mess up below-average students` careers and watch above-average students excel and celebrate their successes and credit them to themselves.

  • @diegomaterano6352
    @diegomaterano6352 10 месяцев назад +10

    omg, I can't belive this has been my favorite lecture, the most fun, entertaining, and easy to understand. I mean it's regex we are talking about, it could have been a completely pain otherwise. Thank you so much David, and the cs50 team for giving us this opporunity to learn from the best

  • @oooogaabooogaa
    @oooogaabooogaa 8 месяцев назад +2

    And here I was thinking I would never grasp regex. Prof. Malan is a one in a million teacher, a true master, an artist at the top of his craft. Many thanks to the whole CS50 crew.

  • @VanishMe
    @VanishMe 7 месяцев назад +6

    I looked into the notes a few times before starting this lecture and i was so confused and was dreading having to learn all of this honestly and was getting desperate and thought i should just quit.
    But David explained it so well, everything just clicked and it all just made sense. Incredible teaching skills. Thank you so much to the entire teaching staff at CS50 and especially David.
    Came into CS50P with no prior coding or CS experience at all and it is such a good feeling seeing the progress i've made so far. What an incredible journey.

    • @VinnieG-
      @VinnieG- 7 месяцев назад

      that official regular expression google would use for matching email adresses made me poop my pants

  • @liyangau
    @liyangau 2 года назад +31

    Hands down the best Regex video I've ever watched. Thank you

  • @davngo
    @davngo 2 года назад +21

    The best explanation of regex that I've ever seen.

  • @sergey_zatsepin
    @sergey_zatsepin Год назад +7

    34:43 works because of last point and $ in regex accordingly, but there is no necessety in ^, it has no effect

    • @mezlatanis
      @mezlatanis 10 месяцев назад

      Thanks was confused on it

  • @drutsuk3598
    @drutsuk3598 2 месяца назад +2

    i am a collage student from VIT , not so great collage but by attending your cource make me feel like i am at havard , you make all concepts so easy to grasp, i really want to come at this year cs50 fest but due to financial limitations i can't , but one day i will really like to meet you in person

  • @sushmasingh9040
    @sushmasingh9040 3 месяца назад +1

    best cs50p lecture so far

  • @evachen8623
    @evachen8623 Год назад +3

    This class is way harder than I thought before, but thankfully there's David Malan answering all the questions right after they pop up in my brain even though I couldn't even ask.

  • @adileru
    @adileru 2 года назад +5

    David Malan is one in a billion!
    Regards from Romania

  • @bruce2877
    @bruce2877 6 месяцев назад +6

    1:38:58, Seeing David laugh is a joy

  • @Qwonk
    @Qwonk 2 года назад +28

    Take a shot every time David says "Let me propose"

  • @madefromjames
    @madefromjames Год назад +2

    I'm just so happy to learn Python the easy way with David.

  • @mariyayurchenko2790
    @mariyayurchenko2790 Месяц назад

    Bravo, you guide your students through even relatively tricky topic with grace.

  • @sayori3939
    @sayori3939 2 года назад +16

    Hehe i love how David can understand what some foreigners with heavy accent says and hear people basically whispering (cs50x) that's why i could never be a teacher, i would make the students feel uncomfortable asking"what, repeat, what did you say, huh" ;3

    • @sergey_zatsepin
      @sergey_zatsepin Год назад

      Don't be weird, it's totally normal to ask, and David does it on pure CS50 course lectures. And moreover, it's the student's problem if teacher doesn't understand/hear his question.

    • @sayori3939
      @sayori3939 Год назад +3

      @@sergey_zatsepin It's not just him though ._. all my teachers in school had some weird hearing superpower

    • @MattRose30000
      @MattRose30000 Год назад +12

      @@sayori3939 at some point you already know 99% of the questions the students will ask. so you just need to hear certain keywords to figure out what the question is.

    • @pulkitkrishna8809
      @pulkitkrishna8809 Год назад +3

      @@MattRose30000 Exactly. In CS50P, you can see David making some wrong guesses to what the question is.

  • @yqhanliving
    @yqhanliving 10 месяцев назад +1

    So good. Thank you CS50 team!

  • @njmanga617
    @njmanga617 2 года назад +8

    Love the lectures even if I have seen it before never gets boring

  • @yashgoyal905
    @yashgoyal905 2 года назад +8

    Thanks for all of this and your great efforts in teaching. Can't see it live but will definitely see it tonight

  • @relaxmore444
    @relaxmore444 2 года назад +12

    Thank you for doing this David! It made me understand regex better.

    • @sayori3939
      @sayori3939 2 года назад +1

      But that's not fair, you have "Re" and "x" in your name! '0'

  • @priteshugrankar6815
    @priteshugrankar6815 10 месяцев назад

    Man, this is like having Joe Satriani as your guitar instructor!! Amazing stuff!! Thank you sir!!

  • @tsmartins
    @tsmartins 3 месяца назад +2

    1:38:50 reminder to come back and watch my favourite Professor "break out of character"

  • @muzammilomarzoy6616
    @muzammilomarzoy6616 Год назад +2

    00:38:58 - Sets of Characters
    00:49:18 - Character Classes
    01:20:40 - Capturing Groups
    02:00:30 Question

  • @dakoderii4221
    @dakoderii4221 2 года назад +34

    Lectures 1-6 and 8-9: 🤔😀
    Lecture 7: 🤯😩

    • @BT-te9vx
      @BT-te9vx 2 года назад +2

      so true :(

    • @RayhaanKhan-mu4qu
      @RayhaanKhan-mu4qu 8 месяцев назад +1

      trueeee

    • @anthronox4992
      @anthronox4992 4 месяца назад

      It's not your fault bro. Nobody blames you. You can be free now.

    • @anushkaaaa
      @anushkaaaa 3 месяца назад

      this is so true, this lec is definitely harder than the previous ones

  • @monicagalloriofrio9551
    @monicagalloriofrio9551 2 года назад +2

    muy genial Sr... Inspiration for teachers world wide...

  • @mritunjoypaul10
    @mritunjoypaul10 7 месяцев назад

    Hands down best regular expressions lecture

  • @zawarudu9206
    @zawarudu9206 2 года назад

    This one is the best so far and the best lecture I have seen teaching re so far

  • @mostafamarwanmostafa9975
    @mostafamarwanmostafa9975 Год назад +2

    Thank you sir, it helped me in my NLP course!

  • @Neojs565
    @Neojs565 Год назад +2

    I watched till the end and even practiced; this is the first time I understood regex...

  • @williamenur3404
    @williamenur3404 2 года назад +5

    My Progress is very nice thank you David!

    • @mrsan4856
      @mrsan4856 2 года назад

      hii r u at week 7 ?

    • @williamenur3404
      @williamenur3404 Год назад

      @@mrsan4856 I’ve already finished it,and it’s my second time I’m taking CS50P😃

    • @intothepc
      @intothepc Год назад

      What why?@@williamenur3404

    • @abdurrafay1747
      @abdurrafay1747 3 месяца назад

      @@williamenur3404 why second time ?

  • @daughterofanartist7223
    @daughterofanartist7223 4 месяца назад +1

    well explained ! Jazak'Allah hu khair brother. God bless you

  • @kebincui
    @kebincui 2 месяца назад

    the best one in a million❤, thanks David

  • @ManagingSaging
    @ManagingSaging 10 месяцев назад

    Thank you Sir David for super enjoyable lecture!!

  • @vishalverma4838
    @vishalverma4838 Год назад

    Easy to understand and practice, great presentation.

  • @VinnieG-
    @VinnieG- 7 месяцев назад

    I love how David tries to break the code, and still made it work somehow 1:39:00

  • @Nguyen_An369
    @Nguyen_An369 Год назад

    Thank Mr.David J. Malan so much

  • @Jgift_9x
    @Jgift_9x 2 года назад +6

    keep CS50 on the Lecture Hall classroom < please >. You are not just another Online class.

    • @sayori3939
      @sayori3939 2 года назад +1

      Is that lecture hall the place that he teaches introduction to computer science, if so, yeah i miss that place too

  • @maggotdeath12
    @maggotdeath12 Год назад +1

    Благодаря ти, брат

  • @baris5081
    @baris5081 2 года назад +2

    great teacher

  • @VinayakGNair
    @VinayakGNair 2 года назад +2

    Very tricky lecture. Regular expression is little difficult to get hold of.

  • @techninja2940
    @techninja2940 2 года назад +1

    Brilliant 👨‍🏫

  • @donermannali2701
    @donermannali2701 11 месяцев назад

    man I love this man

  • @0765
    @0765 2 месяца назад

    Somebody please explain why it is greedy with the '?' but not '*" at 1:29:11? And when I omit the comma before the whitespace, it is not greedy anymore, even thought keeping the '?'

  • @adam_belounis.
    @adam_belounis. 7 месяцев назад

    Enjoyable , educational

  • @nicomal
    @nicomal Год назад +1

    Complement this class with the Socratica video on regular expressions.

  • @mahipalmahato7648
    @mahipalmahato7648 2 года назад +1

    re start at 1:00:51

  • @sayori3939
    @sayori3939 2 года назад +1

    Around 1:20:00 i know the main point of the video is to show RE but wouldn't it be safer if you just split the string with , (without space) then stripped the white spaces in the variables?

    • @sayori3939
      @sayori3939 2 года назад +1

      That match group is incredible :0

  • @vatsoffice
    @vatsoffice 9 месяцев назад

    in the capturing groups part, when you wrote the final group for matching, will it work for that David Malan Jr?

  • @nowak93
    @nowak93 2 года назад

    this tickles my brain

  • @manuellayburr382
    @manuellayburr382 Год назад

    Mystery at 48:30 - In the code at line 5 in the regular expression, we incorrectly have ".eu$" instead of ".edu$". Yet the program still validates the email address! Why?

    • @samfisher8583
      @samfisher8583 Год назад

      I went down to the comments to find an answer too? You know what's the problem?

    • @princewaesen154
      @princewaesen154 Год назад

      Huh?

    • @anthronox4992
      @anthronox4992 4 месяца назад

      We have ".edu$". You must be mistaken.

  • @ivanpiskovic4151
    @ivanpiskovic4151 4 месяца назад

    Is the diagram in this video at 21:40 depicting a moore machine,

  • @oyekanmibamidele6196
    @oyekanmibamidele6196 2 года назад

    What a great tutorial!

  • @intxcated
    @intxcated Год назад +1

    2:03:03 can we just use (\w+) instead of [a-z0-9_]+ ?

    • @paulkyle
      @paulkyle Год назад

      I think David didn't use it because that would allow upper case letters in the user name

    • @intxcated
      @intxcated Год назад

      @@paulkyleOh I thought it didn't matter since we were using re.IGNORECASE

  • @adam_belounis.
    @adam_belounis. 7 месяцев назад

    David is the best

  • @denisc.1282
    @denisc.1282 2 года назад

    Can there be conditionals? Let’s say I don’t want letter o be right next to digit 0 when it appears for the first time in the string

  • @شیداعسکری-ل5ل
    @شیداعسکری-ل5ل 8 месяцев назад

    Thank you❤

  • @sayori3939
    @sayori3939 2 года назад +2

    "working 9 to 5" pset made me feel like i had worked from 9 to 5 and made me feel upset :(
    66 lines of pure hackish code but hey at least i learned you can actually name the groups in the search like (?P) and then m.group('name') that's pretty cool :3

  • @Mecutiesweetie
    @Mecutiesweetie Год назад

    It's so helpful, thank you ! But why is there no word about re.compile function? is it not so vital in regex?

  • @mattryan6832
    @mattryan6832 8 месяцев назад +2

    start: farmer grows the carrot ^, end: farmer profits $

  • @TrismegistusH
    @TrismegistusH Год назад

    1:28:52 he says that "?" is 0 or more but the notes say 0 or 1?

    • @pabloa.2586
      @pabloa.2586 Год назад

      "?" is 0 or 1. "Malan, David" worked because the ".+" tolerates and captures the big chunk of whitespaces

    • @TrismegistusH
      @TrismegistusH Год назад

      yes i realized he misspoke@@pabloa.2586

  • @williamenur3404
    @williamenur3404 2 года назад

    Course is Best

  • @g.d..
    @g.d.. 2 года назад +3

    very good lecture, thank you very much, is there a lecture planned for Lists and Dictionary presently?

  • @AdamRakhamim
    @AdamRakhamim Год назад

    bookmark 49:00

  • @Navdeep-nq9ui
    @Navdeep-nq9ui Год назад

    thank you sir

  • @Vicktor69
    @Vicktor69 2 года назад

    Thank you!

  • @appleapple1763
    @appleapple1763 2 года назад

    30:00 what does it mean?

  • @8trakau
    @8trakau Год назад

    DJM you will always be "Space David" to me now :)

  • @Mayday-wy2yp
    @Mayday-wy2yp 26 дней назад

    Are you ready to see what exactly browsers use for that??

  • @ArbaazBeg
    @ArbaazBeg Год назад

    can you use dark mordern theme?

  • @SoyedReyazulIslamReyad
    @SoyedReyazulIslamReyad 2 месяца назад

    So you are telling me that I could just do it to make that vanity plate thing?

  • @mahmutpekkara
    @mahmutpekkara 21 день назад

    Remember that sometimes you open up a some obscure file and Microsoft WordPad shows you a weird bunch of characters in urls..?

  • @6srer
    @6srer 2 года назад

    Hello from Kenya

    • @danielwari2760
      @danielwari2760 2 года назад

      Wagwan Solomon ,
      Also from Kenya ,
      Have you taken coding and programming classes from Kenya ?
      Looking to learning python to start my Data science or analyst course .

  • @trunghainguyen9872
    @trunghainguyen9872 2 года назад +3

    1:38:55 funny :)

  • @yessir2649
    @yessir2649 Год назад

    Thank u

  • @aa_yu_s_h
    @aa_yu_s_h Год назад

    I have a great feeling to see you hacking !
    And breaching. 🔥

  • @firefuegomakes
    @firefuegomakes Год назад

    Lesson of the lesson, do not be generous

  • @thyagolopes3020
    @thyagolopes3020 Месяц назад

    Week 7... so close 🤞

  • @amine63404
    @amine63404 Год назад

    01:30:00

  • @isitool8
    @isitool8 Год назад +2

    My head hurts

  • @fionalazarus2166
    @fionalazarus2166 Год назад +1

    You could teach a monkey how to code, literally! Best explanation👏

  • @xue7444
    @xue7444 2 года назад

    This is golden

  • @winstonbarendse3647
    @winstonbarendse3647 2 года назад

    2:01:50

  • @fishnotfosh
    @fishnotfosh Год назад

    @davidjmalan on the watch on youtube homework assignment...why did you put the rickroll link...
    Days since rickrolled reset from 3 years to 0 days. God damn it.

  • @munim6940
    @munim6940 Год назад

    The shout at 56:35 xD

  • @darkooo94
    @darkooo94 2 года назад +4

    What happens at 48:25 when David pastes the set of characters? The suffix ".edu" turns to ".eu" but the code works as it didn't happen.

    • @uniatrix
      @uniatrix Год назад

      I also wanted to know that lol

  • @Raiyan68
    @Raiyan68 Год назад

    1:12:13

  • @Pr0feBboy
    @Pr0feBboy 11 месяцев назад

    While watching the lecture I thought Regex is cool but when I started doing the problem sets for Regex I found out that Regex is a terrible way to handle strings... absolutely cryptic and impossible to learn at first.. It makes me wanna quit studying any type of programming ...

  • @pakchiechan4867
    @pakchiechan4867 Год назад

    59:51

  • @PippyPappyPatterson
    @PippyPappyPatterson Год назад +1

    damn he good

  • @nehanthv4238
    @nehanthv4238 11 месяцев назад

    47:30

  • @ufallo
    @ufallo Год назад

    33:45 "Expressions" Carrot on a string / /Dollar at the end of a string lolol

  • @samirantanen707
    @samirantanen707 Год назад

    "What are you wearing?".strip() doesn't produce None.

    • @StrazdasLT
      @StrazdasLT Год назад

      It can if the user inputs nothing.

  • @pureblood6174
    @pureblood6174 2 года назад

    @57:01 apology accepted

  • @tanjirokamado2855
    @tanjirokamado2855 2 года назад +1

    56:35 🤣 lmfao

  • @sayori3939
    @sayori3939 2 года назад

    I had severe problems with last pset problem, PIL docs is so freaking confusing and not straight it presents functions without telling the argument making you read a whole paragraph and it never raised any errors and the file wasn't saving a new file (INCLUDE THAT IF __NAME__ THINGY AT END!!!) Saddly looking for why my code wasn't working i got spoiled by a function from pil that solved the problem :/ and I COULDN'T FIND IT IN THE FREAKING DOCS even though i clearly imported it from PIL