Regular Expressions (Regex) in JavaScript - tutorial

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

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

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

    for anyone wondering whats the difference between the + and the * sign, I got the answer for that.
    The + sign is true if you have at least 1 match.
    The * sign is true if you have at least 0 matches.

    • @Amine-tl2ul
      @Amine-tl2ul 4 ปีที่แล้ว +1

      thanks man

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

      Yeah he did mention that in the video

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

      @@TheHappyKamper my comment got 54 likes for a reason brah

    • @heimeshc.2039
      @heimeshc.2039 3 ปีที่แล้ว +1

      @@rossocorsa6577 4:27 FYI

  • @ΔημητρηςΝουβακης
    @ΔημητρηςΝουβακης 4 ปีที่แล้ว +22

    At the end you say thank you so much for watching while me must be thankfull to you about your free valuable information.

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

    Our coding bootcamp never covered regex, this is gold. Thanks so much!

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

    Doing a paid coding bootcamp and they failed to explain this is an understandable way. Thanks freeCodeCamp :P

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

    This was a great tutorial man, thanks! I like how you also pointed out a resource for us to use to continue learning and testing it ourselves. Got it is one go and can continue to learn.

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

    Thank you so much. You just helped me with my project. I was struggling with regular expression

  • @sarunasknabikas5067
    @sarunasknabikas5067 4 ปีที่แล้ว

    Thanks! Great video helped to get a better idea of what regex is all about.

  • @atanoomandian3980
    @atanoomandian3980 4 ปีที่แล้ว

    Thanks for this brief and useful regex tutorial

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

    This dude gives me the chills...

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

    Thanks

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

    I got it in one go . Thank you bro

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

    Thank you so much for such a good basic explanation of regex.

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

    Well done, thanks for your efforts

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

    manager: the coder's name is cody?
    me: maybe that's why he became a coder

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

      nominative determinism strikes again

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

    This is wonderful, thank you.

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

    This is a great tutorial
    Thanks!

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

    cool it gave me a better understanding of regex

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

    instead of showing your image just show the code on the whole screen

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

      Ur fucking stupid lol

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

    i set as one of my life goals to make a high budget film about, the expansion of the roman empire, the greatest empire ever, the emprire that set out how the wester world will later opperate!. LONG LIVE THE EMPIRE!!!

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

      i know this is a coding tutorial, i just feel hyped up about the roman right now, and diseded to share it, seriously go search about it ITS AWESOME

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

    This man is very serious :)

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

    Thanks for the lecture! Would be nicer if you could provide some "real-life" applications I guess.

  • @andrewwachira1
    @andrewwachira1 5 ปีที่แล้ว

    Best one on the web!

  • @harshthechampful
    @harshthechampful 6 ปีที่แล้ว

    Brilliant introduction to the topic...very good content for beginners...

  • @pedroalonsoms
    @pedroalonsoms 3 ปีที่แล้ว

    Very useful. Great video thanks

  • @AdamSmith-de5oh
    @AdamSmith-de5oh 4 ปีที่แล้ว

    Fantastic ornate cornicing.

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

    Thanks for the overview!

  • @SumanKumar-ek9yw
    @SumanKumar-ek9yw 5 ปีที่แล้ว

    great video for basics

  • @luisdwq123
    @luisdwq123 4 ปีที่แล้ว

    Great tutorial thanks!

  • @danieljacobsen6766
    @danieljacobsen6766 4 ปีที่แล้ว

    Thanks for this great video!

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

    lol literally after understanding what this is its my favorite thing :D

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

    Coder Cody or Cody the Coder, im sure you get that a lot lol

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

    good video - thanks

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

    finely thanks very match i understand know

  • @aaronargottelopez3488
    @aaronargottelopez3488 4 ปีที่แล้ว

    Thanks!

  • @geekyprogrammer4831
    @geekyprogrammer4831 5 ปีที่แล้ว

    that site is amazing!

  • @PlayBetterJazz
    @PlayBetterJazz 6 ปีที่แล้ว

    very helpful video, thanks!

  • @solmadison
    @solmadison 6 ปีที่แล้ว

    this was great. thanks!

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

    I’m finding it difficult to understand why/how it is that we iterate through the file names in the loop. I understand when it finds the match prior to the loop. But when you go into the loop, you print out the file name (still understand THAT), but then you set match again to regex.exec(string) and magically it goes to the next grouping without ever modifying string or telling the computer to go to the next word or anything... the string doesn’t change, the regex doesn’t change...wouldn’t match be the same each time you iterate the loop, resulting in an infinite loop?

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

      EXACTLY my doubt.
      EDIT : Tried it out. That is how it works. You need to iterate over it to find successive matches it seems. Weird. Why not return all matches in one list?
      EDIT2: You need to turn your global(g) flag on, in your original regex, else it creates an endless loop it seems.

  • @shubhamray6839
    @shubhamray6839 4 ปีที่แล้ว

    You are amazinggggggggggg.....

  • @arturoordonez-hernandez1534
    @arturoordonez-hernandez1534 6 ปีที่แล้ว +3

    I see my mistake now, I had my string literal within quotes. I thought I was supposed to treat the regex pattern as a string literal.

  • @MasterZiomekPL
    @MasterZiomekPL 5 ปีที่แล้ว

    thank you, very cool

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

    Regex is the term for not being accepted

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

      haha "rejects" so funny omg

  • @salimmountassir4260
    @salimmountassir4260 6 ปีที่แล้ว

    thank you so much !!!!!

  • @santiagoalmiron5345
    @santiagoalmiron5345 3 ปีที่แล้ว

    thank's

  • @seassault
    @seassault 4 ปีที่แล้ว

    awesome

  • @mnageh-bo1mm
    @mnageh-bo1mm 5 ปีที่แล้ว

    the best one of them :)

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

    Good stuff, but the volume is too low for a YT video. I had to increase the volume, but then all the other videos were too high in volume.

  • @rossocorsa6577
    @rossocorsa6577 5 ปีที่แล้ว

    hey cody im cody too

  • @MrBobstah
    @MrBobstah 5 ปีที่แล้ว

    Life saver

  • @rogerpantil9483
    @rogerpantil9483 4 ปีที่แล้ว

    good tutorial, but the fonts are way too small

  • @alehunter15
    @alehunter15 6 ปีที่แล้ว

    cool thnx mate

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

    how does "REGULAR EXPRESSIONS" - turn into Rej-Ex ?

  • @Timetonut
    @Timetonut 6 ปีที่แล้ว

    this was interesting, but I'm searching for a secret of matching titles in an app. A few song titles are one word, but most have several words. In the app, I'd like for the spaces between words to be either ignored or not have the JavaScript eliminate the space once it was recognized as a match. I'm not sure if the problem is regex or getting JavaScript to play ball.

  • @Haemma833
    @Haemma833 5 ปีที่แล้ว

    Hello Cody. Thanks for the great tutorial. Is it possible to reach you somehow? Thanks. Greetings from Austria.

  • @02orochi
    @02orochi 5 ปีที่แล้ว +1

    its regex, not rejects

  • @kennethrebello4522
    @kennethrebello4522 5 ปีที่แล้ว

    Ironic how to the the actual learning part is the smallest frame of the video.

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

    BUT why the c is marked though?

  • @happykhan299
    @happykhan299 4 ปีที่แล้ว

    Hi..can someone help me on my problem...how can I sort, filter and set ranges columnwise on notepad ++.. I am struggling to find the right solution for this issue I am facing..thank you in advance..

  • @Captinofthemudslayer
    @Captinofthemudslayer 4 ปีที่แล้ว

    Question: I have the following regex and text and i would like to match all doubles. However when I try to match them all it skips the 2nd line. How come? Note i am working in bash via mac terminal.
    what flags should i used besides -o and -i
    ([a-z]+) +\1
    Paris in the the spring.
    The theoretical viewpoint is of little value here.
    I view the theoretical viewpoint as being of little value here.
    I think that that is often overdone.
    This sentence contains contains a doubled word or two two.
    Fear fear is a fearful thing.
    Writing successful programs requires that the the programmer fully understands the
    problem to be solved.

  • @fredasigurdsson7063
    @fredasigurdsson7063 4 ปีที่แล้ว

    Idk if it's something in the audio or if his accent is a bit different but I found it quit hard to grasp everything he was saying

  • @matthewpan4338
    @matthewpan4338 4 ปีที่แล้ว

    what is the IDE he's using?

  • @AP-gc5ss
    @AP-gc5ss 4 ปีที่แล้ว

    You look like Diane Kruger

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

    @3:36 ah, you've gotten to that age when you forget how old you are. i was 27 when it happened to me XD

  • @justadev____7232
    @justadev____7232 5 ปีที่แล้ว

    I don't get where he is testing [a-z]{1,4}. Your testing if it has 1-4 characters? (name is) is more than 4 characters, so how come it evaluates to true?

    • @justadev____7232
      @justadev____7232 5 ปีที่แล้ว

      nevermind we are evaluating the word after name is. I got it

  • @joshysmarty2540
    @joshysmarty2540 5 ปีที่แล้ว

    Find other resources???

  • @kanemku
    @kanemku 5 ปีที่แล้ว

    What a G!

  • @somyagupta8215
    @somyagupta8215 3 ปีที่แล้ว

    ?.co& what will be regex for this

  • @nickwoodward819
    @nickwoodward819 6 ปีที่แล้ว

    @7:27 bit confused as to why that doesn't match. "'There's no character [a-z] here." I agree, but if you remove the whitespace & 'and' at the end of the sentence, it will match
    why does 0 or more [a-z] characters get ignored when at the end of a sentence, but not in the middle?
    eg:
    my name is 0 and i'm 34
    /my name is [a-z]*/ --- matches "my name is"
    /my name is [a-z]* and/ -- doesn't match anything

    • @nickwoodward819
      @nickwoodward819 6 ปีที่แล้ว

      i think i worked it out. it's because by having '0' of a character it then has to match the space either side of it.
      so /my name is [a-z]* and/ would match 'my name is (two spaces here) and'

  • @Apofisbg
    @Apofisbg 5 ปีที่แล้ว

    someone is playing EE2

  • @lycan2494
    @lycan2494 5 ปีที่แล้ว

    why he look possessed lmaoo his eyes

  • @oguz-kagan
    @oguz-kagan 5 ปีที่แล้ว

    is this necessary?

  • @Beny123
    @Beny123 3 ปีที่แล้ว

    I don’t think this is a good tutorial . Or did I miss the first part ?

  • @minnesotacodingacademy
    @minnesotacodingacademy 4 ปีที่แล้ว

    I guess you are standing so your face is blocking the code, that's why I cant see the lookaheads lol

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

    I liked her but she regex me :(

  • @besthobbit
    @besthobbit 8 หลายเดือนก่อน

    This might be a good video but I can't stand 'rej-x'

  • @Falzer
    @Falzer 4 ปีที่แล้ว

    *All your are belong to me*

  • @sidima2269
    @sidima2269 4 ปีที่แล้ว

    Very handsome

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

    He sighed like 20 times in 17 minutes. Clearly, he was very annoyed to make this video. Really unprofessional.

    • @jeff-creations
      @jeff-creations 3 ปีที่แล้ว

      It was the smoke detector chirping in the back-ground that was annoying him....most likely

    • @jeff-creations
      @jeff-creations 3 ปีที่แล้ว

      Just replace all of the smoke detector batteries at the same time, even if you don't think they need it. It's really the only way to ensure all batteries remain at the same voltage. Otherwise you will be replacing one battery after another and not really know which detector is causing the issue ( at 3am of course ... lol ).

    • @jeff-creations
      @jeff-creations 3 ปีที่แล้ว

      Extremely helpful video, top notch Cody. Thanks!