Complete Regular Expressions Tutorial! (with exercises for practice)

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ธ.ค. 2024

ความคิดเห็น • 44

  • @BhushanPatil-v8i
    @BhushanPatil-v8i 9 หลายเดือนก่อน +1

    37:54 you can use range eg. [1-31]

  • @Fflaring
    @Fflaring ปีที่แล้ว +5

    Oh man, I waited this so long, thank you for this video!

  • @rayedriasat8
    @rayedriasat8 10 หลายเดือนก่อน +1

    at 38:52 I used [01][0-9][-./][0-3][0-9][-./]\d{4}
    here inside [ ] square brackets we don't need to escape the dot (.) it is just dot, if we had used dot outside of square brackets then we had to escape dot. Cuz dot outside [] means everything except newline

  • @Evan-e-cent
    @Evan-e-cent ปีที่แล้ว +3

    Hi, I hope you don't mind if I comment on names for symbols:
    # is called 'pound' because on British keyboards it is the money symbol £ (try option#)
    ! is the exclamation point or mark that you referred to later
    < I call the less-than symbol or angle bracket in HTML
    > is the greater than symbol (it is bigger on the left side)
    * is an Asterisk which means star. Commonly called just 'star'.
    | is sometimes called a pipe or vertical bar
    THANKS FOR A GREAT VIDEO ! WATCHED FROM BEGINNING TO END
    and made a note of the PDF cheat sheet. Very useful.

  • @giacomobianchi3857
    @giacomobianchi3857 ปีที่แล้ว +3

    Finally I understood regex!!! Thank you

    • @KeithGalli
      @KeithGalli  ปีที่แล้ว

      You're very welcome! Glad it was helpful.

  • @ahmadshabaz2724
    @ahmadshabaz2724 ปีที่แล้ว

    nothing better than entire you tube . your work is awesome . its really helpful man . thanks a lots

  • @stefanomedici5326
    @stefanomedici5326 ปีที่แล้ว +4

    Always super helpful! Thank you Keith :)

  • @leonardoferreiracalazans9210
    @leonardoferreiracalazans9210 10 หลายเดือนก่อน

    Thank you for the video!
    In negative lookbehind, try to use \b before the pattern you want to match. It has worked for me!

    • @KeithGalli
      @KeithGalli  10 หลายเดือนก่อน

      Thanks for the tip! Glad you enjoyed the video

  • @michaelpurtell6157
    @michaelpurtell6157 ปีที่แล้ว +1

    The legendary movie from Feb 1996 was Happy Gilmore! It surely contributed to the recent Kennedy Center honors for Adam Sandler. And a great video released on April 13, 2023 is the RegEx tutorial from Keith Galli, great job.

    • @KeithGalli
      @KeithGalli  ปีที่แล้ว

      Correct, and haha thank you for the kind words! Glad you enjoyed :)

  • @johnnybegood948
    @johnnybegood948 ปีที่แล้ว +1

    You are the best! Thank you for this video
    props from brazil

  • @anonviewerciv
    @anonviewerciv ปีที่แล้ว +1

    My body is regex. 🔎📃
    10:50 Linguistically speaking, [y] can be a vowel, especially in words like "crypt". Pedantry of course, since it could just be added into the regex if needed. 🤓
    36:40 Might not really be up to regex to do data validation. There are better tools for that. 🧰
    In fact, integrating these into data workflows would be a good follow-up video for the future. ▶

  • @maxximumb
    @maxximumb ปีที่แล้ว

    Ali sent me. Am so glad she did. You have some great videos.

  • @motlatsimoea5615
    @motlatsimoea5615 ปีที่แล้ว +1

    Yes!!!!!!! Favorite tutor about to tackle a subject I've beeeeeeeen wanting to learn! Can't fight fate!
    Let's go!!!!!!!!

  • @javaluvawithjeremystones6315
    @javaluvawithjeremystones6315 7 หลายเดือนก่อน +1

    Really amazing video! Thanks for the great content!
    For the part where it was allowing you to not escape the period in the square brackets, it's not sublime, you don't need to escape characters inside square brackets, although it won't complain if you do escape them. The only exception I can currently think of is the ^ symbol and only if you put it at the beginning.

  • @flioink
    @flioink 7 วันที่ผ่านมา

    The brackets are also known as "chevrons". Caret is just "^"

  • @shawnabirnbaum8658
    @shawnabirnbaum8658 ปีที่แล้ว +1

    I would love to see a video on syntax trees and X' theory!

  • @ucphattruong4341
    @ucphattruong4341 ปีที่แล้ว

    Omg. Thanks to you, I could understand the regex. You're truly life saver

    • @KeithGalli
      @KeithGalli  ปีที่แล้ว

      Glad the video was helpful!!

    • @youturunnyng
      @youturunnyng 5 หลายเดือนก่อน

      ​@@KeithGalliRubén godoy islas

    • @youturunnyng
      @youturunnyng 5 หลายเดือนก่อน

      Rubén godoy islas

  • @jojithekkan3713
    @jojithekkan3713 2 หลายเดือนก่อน

    You can use the following regular expression in Python to check for a valid two-digit month (01 to 12):
    import re
    # Regular expression pattern for two-digit month (01 to 12)
    pattern = r"^(0[1-9]|1[0-2])$"
    This is the answer for your question at 39th minute

  • @DendrocnideMoroides
    @DendrocnideMoroides ปีที่แล้ว

    a period in a character class only matches a period, same for the other metacharacters like ? * +, the reason for this is there is no use to have a character match every character inside a character class, since for that you would not even need a character class, similar reasoning for the other metacharacters

  • @billsneddon
    @billsneddon ปีที่แล้ว +4

    not optimal but (0[1-9]|1[0-2]) would only match months 01-12

    • @KeithGalli
      @KeithGalli  ปีที่แล้ว

      That's a smart solution! Didn't think of that, thanks for sharing :)

  • @HaktanErarslan
    @HaktanErarslan ปีที่แล้ว +1

    Great video, Could you please prepare new video(tutorials) about ML?

  • @shangtee1
    @shangtee1 ปีที่แล้ว

    Very useful!

  • @FUNNEAS
    @FUNNEAS ปีที่แล้ว +1

    Hi Keith, excellent video on regex.... One of the best videos made ever on youtube on regex.....im glad i found your video.......Can you make video on finding specific word in a sentence ex (i want to cancel my service. Please cancel my hbo, i want to can sail please console my service, im interested in cancelling) multiple words like this and we want to match word only (cancel | can sail |console service) and ommit any other word like 'cancel hbo' 'cancel bill' ..... Any way can i reach out to you personally with sample. Thanks

  • @DendrocnideMoroides
    @DendrocnideMoroides ปีที่แล้ว +1

    49:02 You could definitely get everything if you add an extra parenthesis around the thing you want to get in this case (([a-z][A-Z])+[a-z]?)@(\w+\.\w+)

  • @JumaleAbdi-tu3zh
    @JumaleAbdi-tu3zh ปีที่แล้ว

    Hey, Thank you for the amazing content. Please Would you mind covering about End to End Pytorch series from the Problem statement, Data Collection, Modeling, Deployment, and Testing

  • @rudyten
    @rudyten 2 หลายเดือนก่อน

    i gave up on ya after the groups. lol moving on another tutorial

  • @wahidali9145
    @wahidali9145 ปีที่แล้ว

    Hey keith, im looking for data science job. Can you help in that, any reference

  • @MrBulatovich
    @MrBulatovich ปีที่แล้ว

    Так-то ничё! Просто и понятно.

  • @sloughpacman
    @sloughpacman ปีที่แล้ว

    Happy Gilmore 😀

    • @KeithGalli
      @KeithGalli  ปีที่แล้ว

      Haha you got it! 🤝

    • @sloughpacman
      @sloughpacman ปีที่แล้ว

      @@KeithGalli Good video Keith, and some good links too. Regex is a fun diversion from time to time, just like playing around with AWK and SED in shell scripts. If you ever get some time to explore hacking binary/executable files I would recommend it, you'll find it very satisfying and right up your street.

  • @dsinghr
    @dsinghr 9 หลายเดือนก่อน

    the password regex is not working for me!

  • @user-jj4dz2wt7i
    @user-jj4dz2wt7i ปีที่แล้ว

    Hey Keith! Here from Ali's channel. I wanna see my name in sparkles aa

  • @sebastianalvarez1537
    @sebastianalvarez1537 ปีที่แล้ว

    lets go