Regular Expression Tutorial Python | Python Regex Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 มิ.ย. 2024
  • Regular expression python tutorial. I will take a real life example of extracting information out of tesla's company filing and show you how you can use regular expression in python to extract some of the required information easily.
    Code: github.com/codebasics/py/blob...
    Exercise: github.com/codebasics/py/blob...
    ⭐️ Timestamps ⭐️
    00:00 Introduction
    00:32 Coding
    24:34 Exercise
    Do you want to learn technology from me? Check codebasics.io/ for my affordable video courses.
    🌎 Website: codebasics.io/
    🎥 Codebasics Hindi channel: / @codebasicshindi
    #️⃣ Social Media #️⃣
    🔗 Discord: / discord
    📸 Instagram: / codebasicshub
    🔊 Facebook: / codebasicshub
    📱 Twitter: / codebasicshub
    📝 Linkedin (Personal): / dhavalsays
    📝 Linkedin (Codebasics): / codebasics
    🔗 Patreon: www.patreon.com/codebasics?fa...
    ❗❗ DISCLAIMER: All opinions expressed in this video are of my own and not that of my employers'.

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

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

    Do you want to learn technology from me? Check codebasics.io/ for my affordable video courses.

  • @saubhiksom
    @saubhiksom 2 ปีที่แล้ว +11

    Thank you so much Dhaval for this session. I was literally waiting for someone to teach regex like this. Not only in data science even in Bioinformatics and genomics regex is a very very useful module.

  • @prateekbansal8302
    @prateekbansal8302 2 ปีที่แล้ว +39

    Thank you so much for this video! Honestly I used to be scared of regex. Now, not so much anymore. Sir, you’re a real gem!

  • @NamidigerPicue
    @NamidigerPicue 2 ปีที่แล้ว

    the smoothest regex explanation i've ever watched. thank you so much

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

    I was facing problems with regular expressions before watching this video, But now I have solved my assignment on my own after watching this single video, Thanks a lot sir for such amazing educational videos. Love from Pakistan

  • @srd8302
    @srd8302 2 ปีที่แล้ว

    This is the best regex tutorial I have seen so far. Thank you Dhaval.

  • @detacreations1999
    @detacreations1999 2 ปีที่แล้ว

    Before codebasics video people scare regex but after this video all codebasics subscribers love regex..Thanks sir:)

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

    I just wanna say I have no words, never saw such kind of explanantion! Thank you so much sir

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

    Thank you so much for this. I was getting confuse in a code, but youade it clear. :)

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

    Finally a clear explanation of this topic. Thanks!!’

  • @shreyapaurav5930
    @shreyapaurav5930 2 ปีที่แล้ว

    Such simplified way to explain regex.. This really helped

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

    What a beautiful explanation, loved it. regex were always scary but seems like i can try my hands on it.

  • @Lnd2345
    @Lnd2345 2 ปีที่แล้ว

    Extremely useful and clear exposition. Thanks

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

    This is the best video on regex on the entire TH-cam Seriously! I used to be scared of Regx before but now I no longer have to be afraid of Regex

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

    So much information about regular expression, I have found in this tutorial.
    The main thing i want to notice that this tutorial will help you that ,how to think before writing an expression👍👍

  • @dorherbesman1751
    @dorherbesman1751 2 ปีที่แล้ว

    best regex tutorial i found, thank you for your work!

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

    Best video on Regex!! Thank you so much!!

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

    Your tutorials are the best always well explained and with real life examples

  • @user-dj3ty6th6r
    @user-dj3ty6th6r หลายเดือนก่อน

    Brilliant video, 2 week of me struggling to understand regex, NOW ITS OVER YEAH! Thankyou so much, pls have a pleasent and great life🎉

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

    I completed the exercises, thanks man!🙏

  • @mukeshkumaryadav350
    @mukeshkumaryadav350 2 ปีที่แล้ว

    Thanks a lot , landed after watching code with Harry playlist to solve his exercise got stuck . He is also a great teacher.

  • @adarsharora6097
    @adarsharora6097 11 วันที่ผ่านมา

    Thankyou Dhaval Sir! Really helpful!

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

    Maja aavi gai...boss..
    Aabhar🙏

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

    Thank you sir for creating this video!!! you really save me for getting lost in this subject

  • @UpendraKumar-zc8lm
    @UpendraKumar-zc8lm 2 ปีที่แล้ว

    Thank you very much sir, for such a awesome video. Your way of teaching make everything easy. :)

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

    You are a very very good teacher, and your videos on this and other subjects are an enormously positive contribution to the world. Thank you.

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

    I love this!
    I don't know why I thought regex is so complex 🤦🏽‍♀️
    Thank you so much.

    • @codebasics
      @codebasics  2 ปีที่แล้ว

      Happy to help Emma!

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

    Beautifully explained!

  • @sagarmehla2102
    @sagarmehla2102 2 ปีที่แล้ว

    wonderful way to learn regex. Awesome try.

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

    Thanks alot..I was confused earlier..Gonna try this..I loved your teaching :)

  • @iReaperYo
    @iReaperYo 2 ปีที่แล้ว

    thank u sir really important lesson. will allow me to brush up on this skill!

  • @redroom07
    @redroom07 2 ปีที่แล้ว

    impressive ❤️❤️❤️❤️.. thank you very much sir , that i was looking for ...

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

    Woww Tutorial... Thank You!!

  • @nastaran1010
    @nastaran1010 6 หลายเดือนก่อน

    thank you so much, your teaching is the best. good luck

  • @MrChber
    @MrChber 2 ปีที่แล้ว

    Awesome waiting for this 😊

  • @poppinschibuike1737
    @poppinschibuike1737 2 ปีที่แล้ว

    Broke it down beautifully

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

    Such a wonderful explanation .😊

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

    Excellent tutorial Dhaval.

  • @nikhildesai2460
    @nikhildesai2460 2 ปีที่แล้ว

    Thanks for sharing this.. So much helpful to All..

  • @sumitpandey6174
    @sumitpandey6174 2 ปีที่แล้ว

    Best RE explanation ever

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

    Thanks Dhaval, it helps a lot.

  • @Dope619
    @Dope619 2 ปีที่แล้ว

    Surely waiting for this one

  • @marcelocipriano5985
    @marcelocipriano5985 2 ปีที่แล้ว

    Great explanation! Thkx!

  • @mohsenqureshi6318
    @mohsenqureshi6318 2 ปีที่แล้ว

    Great video! Thanks

  • @Shubham-Singh-Rajput25
    @Shubham-Singh-Rajput25 2 ปีที่แล้ว +3

    This is gona be so fruitful 👍 looking forward for regex playlist

  • @ilhemwalker9145
    @ilhemwalker9145 3 หลายเดือนก่อน +1

    i've never liked regular expressions in my life now i do !

  • @muhammedthayyib9202
    @muhammedthayyib9202 2 ปีที่แล้ว

    Reallly nice presentation

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

    Tons of thanks to you bro this video helped me alotttttt

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

    I did understand your explanation it’s very complex

  • @abhi9029
    @abhi9029 2 ปีที่แล้ว

    Superb Tutorial.

  • @avi8016
    @avi8016 2 ปีที่แล้ว

    Great video sir 🙏

  • @ArunKumar-yb2jn
    @ArunKumar-yb2jn 2 ปีที่แล้ว

    Can't wait boss!

  • @MadhurimaPaul-kl2yd
    @MadhurimaPaul-kl2yd 11 หลายเดือนก่อน

    Thank You sir for this tutorial

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

    Awesome Video

  • @krishnadhakal5246
    @krishnadhakal5246 2 ปีที่แล้ว

    Thank you so much for this.

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

    Thankyou sir... This session was really good... I always had a feeling that regex is something that I will never get a grip on... Thanks for your tips

    • @codebasics
      @codebasics  2 ปีที่แล้ว +2

      Vinay I am glad you found it useful

    • @sumit121285
      @sumit121285 2 ปีที่แล้ว

      Same felling had with me Vinay , but after watching this video it's all brushed up....

  • @naveenmallampati3294
    @naveenmallampati3294 2 ปีที่แล้ว

    Fucckkk.. Yess mann.. This is what I am looking for a long time.. Thanx mannn

  • @Loicmartins
    @Loicmartins 6 หลายเดือนก่อน

    Thank you so much!

  • @sumit121285
    @sumit121285 2 ปีที่แล้ว

    You are simply amazing sir...
    Just one thought is coming in my mind ,
    " Agar aap nahi hote to hamara kya hota ? "
    Thankyou , thankyou so much sir ....
    I had really taken lots of efforts to understand regular expression module , but never found such a nice explanation.....
    Thanks again & again .....

    • @codebasics
      @codebasics  2 ปีที่แล้ว

      ha ha ... Thanks for your kind words Sumit

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

    Amazing video

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

    GREAT JOB!!

  • @deepasri9698
    @deepasri9698 2 ปีที่แล้ว

    Thanks for making this video. very useful and more informative.

    • @codebasics
      @codebasics  2 ปีที่แล้ว

      Glad you liked it

  • @devloper_hs
    @devloper_hs 2 ปีที่แล้ว

    Thanks a lot; great explainer straightforwardly; you are meant to simplify complex topics, always refer to your vids.
    However, can u explain the most common re-expression one needs to use in the industry? I mean re any topics to cover?

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

    Sir this is more than perfect, Your teaching is outclass 👍

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

      thanks for your kind words Shafiq 👍🙏

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

    Very helpfull

  • @younessaznag470
    @younessaznag470 2 ปีที่แล้ว

    thank you so match man

  • @prabhakar664
    @prabhakar664 2 ปีที่แล้ว

    Loved It.

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

    Thank you♥️

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

    Waiting g for data engineering playlist ji🤩

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

    You are a god to me.

  • @syedmuhammadrafay228
    @syedmuhammadrafay228 4 หลายเดือนก่อน

    Thanks so much

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

    you are amazing

  • @Cyber_realm
    @Cyber_realm 6 หลายเดือนก่อน

    thanks a lot

  • @freedmoresidume
    @freedmoresidume 2 ปีที่แล้ว

    One of my best tutors on TH-cam

    • @codebasics
      @codebasics  2 ปีที่แล้ว

      :) thanks for your kind words Freedmore

    • @ambaradhikari7425
      @ambaradhikari7425 2 ปีที่แล้ว

      @@codebasics please give the solution of last exercise

  • @krishshah3974
    @krishshah3974 2 ปีที่แล้ว

    amazing :D

  • @sakshikelshikar3729
    @sakshikelshikar3729 2 ปีที่แล้ว

    God bless you

  • @carltondaniel8966
    @carltondaniel8966 2 ปีที่แล้ว

    Thank you so much what a beautiful way to teach , keep the good work coming

  • @user-xy2ly4uz6p
    @user-xy2ly4uz6p 2 ปีที่แล้ว +1

    What if you wanted to extract the text and not the title? What would you recommend?
    Somebody please help!
    Thank you!

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

    Hello Sir thank you so much for this video. But I am really struggling how to find a exact match for example I have a pattern like "Note 8". How should I write a regular expression for it. Please please help me

  • @bunnyvlogs7647
    @bunnyvlogs7647 2 ปีที่แล้ว

    Love u bro

  • @kunalrawat4448
    @kunalrawat4448 2 ปีที่แล้ว +2

    How to practice ml?.
    I'm unable to make project (so many mistakes in making projects) I'm demotivating so guide me 🙏 plz

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

    Thanks for this tutorial. Awesome and simplified. You arreted my regexphobia lolz.... Please can the same regex syntax be used for google forms regex and other rexex scripts?

  • @technicalways2368
    @technicalways2368 11 หลายเดือนก่อน

    Hi actually I have regex Your Orcle instance not running I need to select only Orcle but if the instance is not is there then select oracle so how to do

  • @saurabhbarasiya4721
    @saurabhbarasiya4721 2 ปีที่แล้ว

    Waiting

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

    Hi sir!
    I need ur kind guidance for my project. Will u kindly help me....

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

    lol i like the panda plushie 🐼🐼

  • @waisyousofi9139
    @waisyousofi9139 2 ปีที่แล้ว

    can you write a code to get content which is between two ,word1 and word2
    for eg:
    anything ...word1 ....content....word2..angthing.

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

    can someone explain to me though, in minute 11:00, he used ^
    which is newline, i dont quite get the reason why he use newline so can someone explain it to me? Also why not opted for [\w* or [.*]? Otherwise, this is a great regex tutorial!

    • @Carnivorous-Vegan
      @Carnivorous-Vegan ปีที่แล้ว

      At the time, he was just giving examples of using negated character-sets/classes.
      So he used [^
      ]* as a way of preventing your match from spanning more than 1-line.
      So yes, .* would have sufficed, but note that [.*] only matches 'periods' or 'asterisks'.
      I agree, fantastic tutorial!

  • @kirubababu9255
    @kirubababu9255 2 ปีที่แล้ว

    My delimeter is '' in CSV file, how do I apply regex when reading csv?

  • @sharmeenkhanam2924
    @sharmeenkhanam2924 11 หลายเดือนก่อน

    That title pattern didn't worked for me.
    Please help only 'Note•\d•' has matching pattern

  • @saubhiksom
    @saubhiksom 2 ปีที่แล้ว

    "NM_001111031.2 Homo sapiens activin A receptor type 1C (ACVR1C), transcript variant 2, mRNA"
    Hi! In this string I want to match everything from Homo till the comma. I have written the following code in regex:
    Homo sapiens ([^, transcript variant]*)
    However, it's only matching Homo sapiens but not the other things? The problem is regex is not taking ", transcript variant" as a whole string.
    Can anyone help me please?

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

    pattern='Note \d - ([^
    ]+)'
    re.findall(pattern,text)
    this expression is not working now, idk why, and what to fix in this?? can anyone help?

  • @akashm1027
    @akashm1027 2 ปีที่แล้ว

    bro ending, lol

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

    Do search on any PDF work on regular expression

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

    fire🤣🤣🤣🤣🤣

  • @jojothomas6656
    @jojothomas6656 2 ปีที่แล้ว

    Bro if degree need to get a job for ai or ml engineer

    • @devloper_hs
      @devloper_hs 2 ปีที่แล้ว

      sadly yes, but sometime knowledge and experience wins

  • @ambaradhikari7425
    @ambaradhikari7425 2 ปีที่แล้ว

    Anyone did the last exercise?

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

    Something could have been explained in starting what is \d etc for beginners for those who don’t know anything about regex

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

    10

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

    How can we find 101 from 1101011?

    • @pp.4800
      @pp.4800 11 วันที่ผ่านมา

      //d