Regular Expression Tutorial Python | Python Regex Tutorial

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'.

Пікірлер: 125

  • @codebasics
    @codebasics2 жыл бұрын

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

  • @prateekbansal8302
    @prateekbansal83022 жыл бұрын

    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!

  • @codebasics

    @codebasics

    2 жыл бұрын

    Happy to help Prateek!

  • @sakalagamingyt3563

    @sakalagamingyt3563

    Ай бұрын

    Same bro

  • @saubhiksom
    @saubhiksom2 жыл бұрын

    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.

  • @NamidigerPicue
    @NamidigerPicue2 жыл бұрын

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

  • @srd8302
    @srd83022 жыл бұрын

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

  • @talhanisarmughal
    @talhanisarmughal2 жыл бұрын

    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

  • @kapamagicman
    @kapamagicman2 жыл бұрын

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

  • @vipulsemwal478
    @vipulsemwal4782 жыл бұрын

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

  • @shreyapaurav5930
    @shreyapaurav59302 жыл бұрын

    Such simplified way to explain regex.. This really helped

  • @dorherbesman1751
    @dorherbesman17512 жыл бұрын

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

  • @chitrabhardwaj7292
    @chitrabhardwaj72922 жыл бұрын

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

  • @akashrajendraprasad3717
    @akashrajendraprasad3717 Жыл бұрын

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

  • @detacreations1999
    @detacreations19992 жыл бұрын

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

  • @soorya_ks
    @soorya_ks Жыл бұрын

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

  • @Lnd2345
    @Lnd23452 жыл бұрын

    Extremely useful and clear exposition. Thanks

  • @frankservant5754
    @frankservant5754 Жыл бұрын

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

  • @shahriarshaikat6876
    @shahriarshaikat68768 ай бұрын

    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👍👍

  • @sakalagamingyt3563
    @sakalagamingyt3563Ай бұрын

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

  • @adarsharora6097
    @adarsharora6097Ай бұрын

    Thankyou Dhaval Sir! Really helpful!

  • @mukeshkumaryadav350
    @mukeshkumaryadav3502 жыл бұрын

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

  • @Susanajoan
    @Susanajoan Жыл бұрын

    I completed the exercises, thanks man!🙏

  • @UpendraKumar-zc8lm
    @UpendraKumar-zc8lm2 жыл бұрын

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

  • @emmamargaret2908
    @emmamargaret29082 жыл бұрын

    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!

  • @user-dj3ty6th6r
    @user-dj3ty6th6r2 ай бұрын

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

  • @aakashpatel6191
    @aakashpatel61912 жыл бұрын

    Maja aavi gai...boss.. Aabhar🙏

  • @iReaperYo
    @iReaperYo2 жыл бұрын

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

  • @mklim4509
    @mklim450911 ай бұрын

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

  • @sagarmehla2102
    @sagarmehla21022 жыл бұрын

    wonderful way to learn regex. Awesome try.

  • @Yogesh010Mishra
    @Yogesh010Mishra11 ай бұрын

    Beautifully explained!

  • @nastaran1010
    @nastaran10107 ай бұрын

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

  • @redroom07
    @redroom072 жыл бұрын

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

  • @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.

  • @MrChber
    @MrChber2 жыл бұрын

    Awesome waiting for this 😊

  • @soumyaranjan7474
    @soumyaranjan7474 Жыл бұрын

    Such a wonderful explanation .😊

  • @MegaJohnwesly
    @MegaJohnwesly Жыл бұрын

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

  • @poppinschibuike1737
    @poppinschibuike17372 жыл бұрын

    Broke it down beautifully

  • @nikhildesai2460
    @nikhildesai24602 жыл бұрын

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

  • @raghuvamsiyaram7248
    @raghuvamsiyaram7248 Жыл бұрын

    Excellent tutorial Dhaval.

  • @ArunKumar-yb2jn
    @ArunKumar-yb2jn2 жыл бұрын

    Can't wait boss!

  • @suleymanerim2119
    @suleymanerim2119 Жыл бұрын

    Thanks Dhaval, it helps a lot.

  • @Shubham-Singh-Rajput25
    @Shubham-Singh-Rajput252 жыл бұрын

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

  • @codebasics

    @codebasics

    2 жыл бұрын

    Enjoy!

  • @niranjanbalajisingh6726
    @niranjanbalajisingh67262 жыл бұрын

    Tons of thanks to you bro this video helped me alotttttt

  • @marcelocipriano5985
    @marcelocipriano59852 жыл бұрын

    Great explanation! Thkx!

  • @Dope619
    @Dope6192 жыл бұрын

    Surely waiting for this one

  • @deepali2157
    @deepali2157 Жыл бұрын

    Woww Tutorial... Thank You!!

  • @ilhemwalker9145
    @ilhemwalker91454 ай бұрын

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

  • @AIdevel
    @AIdevel Жыл бұрын

    I did understand your explanation it’s very complex

  • @mohsenqureshi6318
    @mohsenqureshi63182 жыл бұрын

    Great video! Thanks

  • @deepasri9698
    @deepasri96982 жыл бұрын

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

  • @codebasics

    @codebasics

    2 жыл бұрын

    Glad you liked it

  • @user-in5dr7xb1u
    @user-in5dr7xb1u4 күн бұрын

    very useful , thank you 😍

  • @MadhurimaPaul-kl2yd
    @MadhurimaPaul-kl2yd Жыл бұрын

    Thank You sir for this tutorial

  • @sumitpandey6174
    @sumitpandey61742 жыл бұрын

    Best RE explanation ever

  • @vinayraghunath1992
    @vinayraghunath19922 жыл бұрын

    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 жыл бұрын

    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....

  • @shafiqshams3065
    @shafiqshams3065 Жыл бұрын

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

  • @codebasics

    @codebasics

    Жыл бұрын

    thanks for your kind words Shafiq 👍🙏

  • @muhammedthayyib9202
    @muhammedthayyib92022 жыл бұрын

    Reallly nice presentation

  • @krishnadhakal5246
    @krishnadhakal52462 жыл бұрын

    Thank you so much for this.

  • @PicklePops
    @PicklePops2 жыл бұрын

    GREAT JOB!!

  • @abhi9029
    @abhi90292 жыл бұрын

    Superb Tutorial.

  • @Loicmartins
    @Loicmartins8 ай бұрын

    Thank you so much!

  • @solomonodelola-jg7lg
    @solomonodelola-jg7lg17 күн бұрын

    Thank you sir, "the last statements were funny"🤣, you are very good

  • @prabhakar664
    @prabhakar6642 жыл бұрын

    Loved It.

  • @avi8016
    @avi80162 жыл бұрын

    Great video sir 🙏

  • @sumit121285
    @sumit1212852 жыл бұрын

    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

  • @bhaveshvaishnav633
    @bhaveshvaishnav633 Жыл бұрын

    Awesome Video

  • @younessaznag470
    @younessaznag4702 жыл бұрын

    thank you so match man

  • @naveenmallampati3294
    @naveenmallampati32942 жыл бұрын

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

  • @shadiyapp5552
    @shadiyapp5552 Жыл бұрын

    Thank you♥️

  • @Easy_way_of_codeing
    @Easy_way_of_codeing Жыл бұрын

    Amazing video

  • @freedmoresidume
    @freedmoresidume2 жыл бұрын

    One of my best tutors on KZread

  • @codebasics

    @codebasics

    2 жыл бұрын

    :) thanks for your kind words Freedmore

  • @ambaradhikari7425

    @ambaradhikari7425

    2 жыл бұрын

    @@codebasics please give the solution of last exercise

  • @trayambrathore7735
    @trayambrathore7735 Жыл бұрын

    Very helpfull

  • @carltondaniel8966
    @carltondaniel89662 жыл бұрын

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

  • @codebasics

    @codebasics

    2 жыл бұрын

    Thank you, I will

  • @Lifeexperience-rh6og

    @Lifeexperience-rh6og

    Ай бұрын

    But sir if we use voyant tool

  • @syedmuhammadrafay228
    @syedmuhammadrafay2285 ай бұрын

    Thanks so much

  • @devloper_hs
    @devloper_hs2 жыл бұрын

    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?

  • @krishshah3974
    @krishshah39742 жыл бұрын

    amazing :D

  • @sridharpalla5612
    @sridharpalla5612 Жыл бұрын

    You are a god to me.

  • @MukeshYadav-wb5uo
    @MukeshYadav-wb5uo Жыл бұрын

    Thanks alot

  • @utkarshx27
    @utkarshx27 Жыл бұрын

    you are amazing

  • @moganas3232
    @moganas32322 жыл бұрын

    Waiting g for data engineering playlist ji🤩

  • @bunnyvlogs7647
    @bunnyvlogs76472 жыл бұрын

    Love u bro

  • @sakshikelshikar3729
    @sakshikelshikar37292 жыл бұрын

    God bless you

  • @saurabhbarasiya4721
    @saurabhbarasiya47212 жыл бұрын

    Waiting

  • @CEExpansions
    @CEExpansions2 жыл бұрын

    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?

  • @codebasics

    @codebasics

    2 жыл бұрын

    yes.

  • @kunalrawat4448
    @kunalrawat44482 жыл бұрын

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

  • @user-xy2ly4uz6p
    @user-xy2ly4uz6p2 жыл бұрын

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

  • @b1ackwollf
    @b1ackwollf Жыл бұрын

    lol i like the panda plushie 🐼🐼

  • @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

  • @mavericksubarjan2669
    @mavericksubarjan26692 жыл бұрын

    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!

  • @technicalways2368
    @technicalways2368 Жыл бұрын

    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

  • @akashm1027
    @akashm10272 жыл бұрын

    bro ending, lol

  • @studentportal3524
    @studentportal3524 Жыл бұрын

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

  • @calebarodu2245
    @calebarodu2245 Жыл бұрын

    fire🤣🤣🤣🤣🤣

  • @saubhiksom
    @saubhiksom2 жыл бұрын

    "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?

  • @kirubababu9255
    @kirubababu92552 жыл бұрын

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

  • @waisyousofi9139
    @waisyousofi91392 жыл бұрын

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

  • @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?

  • @sharmeenkhanam2924
    @sharmeenkhanam2924 Жыл бұрын

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

  • @NickMaverick4
    @NickMaverick410 ай бұрын

    Do search on any PDF work on regular expression

  • @Theflyinggeek
    @Theflyinggeek3 ай бұрын

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

  • @jojothomas6656
    @jojothomas66562 жыл бұрын

    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

  • @KumR
    @KumR6 ай бұрын

    10