Regular Expressions (RegEx) in 100 Seconds
Ғылым және технология
Learn how to use Regular Expressions, or RegEx, in 100 Seconds. Grab the cheatsheet here fireship.io/lessons/regex-che...
RegExr Tool regexr.com/
#regex #js #100SecondsOfCode
Install the quiz app 🤓
iOS itunes.apple.com/us/app/fires...
Android play.google.com/store/apps/de...
Upgrade to Fireship PRO at fireship.io/pro
Use code lORhwXd2 for 25% off your first payment.
My VS Code Theme
- Atom One Dark
- vscode-icons
- Fira Code Font
Пікірлер: 478
RegEx isn't that hard, the hard thing about it is, you barely use it from a day to day bases. You just end up forgetting how it works and have to look it up again lols.
@Quabbe2
4 жыл бұрын
Agree. I had to look into it for a project and I was able to build the RegEx for my needs within an hour, which was a surprise to me. It bothered me that I didn't take a look on RegEx earlier, but somehow the stigma of being hard to learn turned me off for years
@knowledgenews5343
4 жыл бұрын
I sometimes use regexp with the replace function of VS Code. It is a perfect match for replacing strings.
@kandy1249
4 жыл бұрын
It's used in validation a lot and it comes under good programming practice to have some front end side check for inputs. (That is validating the input even before it is submitted to backend.. or JavaScript validation.. can be used with html)
@TheNewton
4 жыл бұрын
Yup its hard to document properly or build up expressions, all the interactive tools help now though
@vant4u
4 жыл бұрын
It's bread and butter for chip design. Perl, python, TCL.. whatever you script in you gotta know grep, regexp etc. But, with all the switches it's got, it is hard to remember 😂
I personally feel like Regex is relatively simple to write but extremely hard to read (especially for bigger ones)
@avgmean4187
4 жыл бұрын
And people will never, ever, care to split a complex pattern and document it's logic.... Rule of thumb, write obscure RegEx and continue to build upon.
@vibhordube8240
4 жыл бұрын
Just like any other ill formatted code. Simple to write, difficult/impossible to read.
@ltpetrenko
3 жыл бұрын
Simple? Email validation regex challenge anyone ? :)
@teiem5456
3 жыл бұрын
@@ltpetrenko the regex is simple, the email standard is complicated
@ararune3734
2 жыл бұрын
@@ltpetrenko static bool isEmail(const std::string& email) { const std::regex pattern ("(\\w+)(\\.|_)?(\\w*)@(\\w+)(\\.(\\w+))+"); return std::regex_match(email, pattern); } Here it is for C++, this was literally an exam question for me recently, though I was not allowed to use regex :(
Me: Seeing a 3 line regex validating valid input Also me: He's using the language of the gods!
@contactdi8426
4 жыл бұрын
Haha, Seriously! 😛 Same thoughts
@louisrobitaille5810
2 жыл бұрын
In online memes, the robots tell the human that they're the chosen one for understanding the language of the gods (captcha). In reality, we're the ones telling the robots that they understand the language of the gods (RegEx) 😂.
Regex is one of the most useful things I’ve learned regarding programming. Other than searching and validating inputs, it’s also really useful for formatting data.
0:23 this is scary
@Fireship
4 жыл бұрын
That's real production-grade regex for you.
@ry4nolson
4 жыл бұрын
The truly scary thing is that the regex that complies with the actual email address spec is WAY more complicated than that.
I learned in 100 second more than I usually learn in 1 hour article
@edwingarcia5043
4 жыл бұрын
I don't think so
@edwingarcia5043
4 жыл бұрын
If I would not have read some articles about RegExp, this video would be so confusing to me.
@bjerz23
4 жыл бұрын
So true just makes everything so simple
@gambomaster
4 жыл бұрын
We know you are lying. 😁
@TheNewton
4 жыл бұрын
@@edwingarcia5043 agreed somewhat this is a good overview but regex is definately a hands on tool. Thank goodness for all the interactive playgrounds that exist now.
Ive been seen regex for years and years. Understand very little of it, to tell the truth. This video teached me more then all those years, in just 100 sec. Man, from the bottom of my heart: really thank you.
Wow, never would I have thought that someone is able to teach a complex theme like reges in just 100 seconds. You are really talendted, sir!
Love this episode. Regex is legit one of the greatest things you can learn.
Dude, I love that you explain difficult concepts with very concise and awesome presentation. Keep up with that!
These 100 Seconds videos is better than any crash course i have ever seen, you are saving us tons of time. QUALITY CONTENT
Love this very short and quick brain refresher on regular expressions! Thankyou!
Literally struggled with regex in webpack's include yesterday, and now you uploaded this... thank you!
Thanks. Your videos are consistently concise, accurate and straight to the point :) Saved me hours literally!
Honestly this is the first video I have come across that has made RegEx understandable. Everyone doesn’t like 20 minute videos and end up confusing me. And thanks for the site to understand learn how to write RegEx!
I wish I watched this years ago before I tried a dozen times learning this first hand. Very useful, thank you!
one of the best explanations of regex usage out there, great job!
Learning Regex is difficult at first but makes a lot of tasks so much easier, totally worth it just for all the times I have used it to format text files in np++
You make the best tutorials on the platform that I've ever seen. Kudos!
This is the most simple Regex explanation I've ever seen. Thank you.
Man. I love you. I have read regex from different places but i wasn't able to learn. Please make extended version of it. ❤️❤️❤️❤️❤️❤️❤️ You made it hell clear and easy. Thank you very much.
I've been waiting for this video for so long! 😀 Super well explained! Good job!
wow, the most simplified content I've found about regex in JS. Thank you so much !
I never thought Regex would make sense to me, yet here I am, sort of understanding it. Great work!
Since I learned regex, I use it everywhere. Genuinely one of the most useful things in code period.
@pranavnyavanandi9710
2 жыл бұрын
You use it everywhere? But where exactly? Can you give some examples? Thanks.
@TragicGFuel
6 күн бұрын
@@pranavnyavanandi9710 inside vim search and replace, it's a god send when you're updating/rewriting some junior code.
best regex explanation in the world ... and it's a nighmare tool that is largelly used, so you kind of have to learn anyway (and forget about it every time until you use it again and the nightmare cicly repeats in a endless loop).
And there are some gem of a channel on KZread which provide value for long long time. Nice that I follow one
Most useful video I watched this whole month hands down.
Regular Expressions are extremely powerful and the possibilities for combinations/patterns are endless! The only thing to keep in mind might be the performance impact (for example indexOf is faster than a regex for a basic contains-check) and to be as precise as possible in your patterns to keep the amount of processing cycles (to match your pattern) as low as possible (Not sure how the performance is for JS compared to like PHP or Java). Also.. Sometimes it's better to write an opposite, shorter pattern instead of extremely complex pattern to match against (for a basic if-else contains-like check). Anyway, another great 100 seconds video! Looking forward to what will be next!
honestly, I've been using regex for decades and this was the best explanation.
This was awesome. This 100 second is all I need to view everytime I want to use regex
Another bloody top notch video! Although, it's like my Mumma always said - "Never trust anyone who can write regex without googling" 👀😂
Thanks so much, this has been the most informative 100 seconds of my life :D
Once again you have proved to be one of the most gifted people when it comes to educating others and to concepts which are hard to grasp generally. I wish you could do something on recursion in depth and dynamic programming none the less GOD bless you keep it coming
Clear and concise as usual, perfect!
Your videos are so concise and useful. You deserve millions of followers.👏
Liked this channel the first day. Short and direct to the point explanations. I always understand. Thanks 🤩
I love your channel. You make great content that is enjoyable to watch which others programming channel don't do.
This is exactly what i was looking for to quickly learn regex, totally underrated video.
Lol, i only just learned regular expressions and i wish i had been introduced to them a lot earlier. They trivialized so many problems in some of my classes that it makes me angry that we are not taught them.
Super helpful cheat sheet. Your 100 secs are literally a crash course 👍🏼
I watched ad on video because he saved my time, , liked and subscribed as well.. love short videos other people spend 100 secs begging for like share subscribe. This guy deserve it without asking any of it
In my busy schedules I watch your 100 seconds videos and learn in just no time you are awesome dude 🔥🔥🔥
Killer vid as always man. I think this one will be popular for a long time.
This will probably be one of those videos I come back to thousands of times
This explained in 2 minute more than most people explained across 2 weeks
Bro. I could create the RegEx I needed jsut after watching this. You are a legend
I love such fast and informative videos!
Absolutely great explanation! and your editing is awesome haha
Nicely organized examples! Bravo!
I highly recommend using extended regex, you can add line breaks and comments to extended regex and can even attach a tag to each expression and unit test your expression with those tags if you want.
Didn't know I needed this. Thanks!
Best 100sec of my life and u get more info than video tutorials
That was awesome to grasp the fundamental knowledge.
The guys is terrific job. 100 seconds to explain a complex concept is tough.
I used to get scared of Regex, and didn't understand it, I took the time to learn it a few years ago and it's saved me so much trouble. I deal a lot with parsing file formats and tokenized text and I can not express enough how insanely powerful regex is for these types of purposes among many others. It's so useful that it's easy to let yourself fall into the habit of using it for anything that you can use it for, but regex is not always the fastest approach and conversely is often not depending on the complexity of the query. Manual parsing can in many cases be more optimized, however it takes more code and more time to develop, so the trade off need be determined by how many matches you expect to find on average. If you're dealing with millions of matches or more you may consider seeing if there's something more optimized. But baring those cases in most cases the cost is negligible if existent and often pales in comparison to the immense ease of doing these tasks with it. It's one of my favorite tools now, and while I feel I know a lot about it and an pretty proficient with it, I'm still learning tricks with it to this day. You do have to be careful with Regex in various languages, some of the more complicated/sophisticated features work in some languages, don't work in others, or work in a modified way. The more advanced features are a bit less standardized across languages thus you should always research the regex capabilities of the language you're using.
so clearly. You just explain around 2 years of my live
That's it. You are my new favorite KZreadr!!
This video was so amazing! I learned a lot. I Like Regular ezpressions so much 😄😄
Best quick summary of regex on yt
When I first learned of the existence of regular expressions, more than 20 years ago, I simply exclaimed "How could I have lived my life without this?!"
Man, I cannot resist clicking on these videos. Its just 100seconds and i know ill learn something useful
Keep in mind that there's multiple versions/forms of regex. There's a form of it in the Minecraft mod Just enough Items as well as a form of it in some Android file managers and KDE's file manager. The tricky thing is that the syntax for all three, despite all claiming to be "regex", use different syntax.
@mage3690
11 ай бұрын
Dear Christ don't even get me STARTED on the billions of different regex flavors. Lua has a limited version that's totally not a regex but sure as heck looks like it, Bash has _two_ flavors (glob for file searching and a flavor of regex for everything else, and I haven't even mentioned how string expansion screws up escape characters to no end), etc, etc, etc, I HATE MY LIFE. Oh, and speaking of Lua and Minecraft, ComputerCraft uses Lua. It's where I learned to hate Lua. I am now utterly convinced that tables are the literal devil.
If I become a successful web developer/designer.....a major credit goes to you! Thanks for all of these wonderful and cognitive videos! regards.
Thanks this cleared things up, instead of memorizing + and * , ? I recommend using this syntax {1,} means one or more, {2,} means two or more or {2,3} between 2 and 3
this is so good! thanks you
Beautiful! We'd love to see XPath now (for searching HTML, etc.).
Simple and complete.
Dude you are amazing. thanks!
very well explained, thank you so much
❤️❤️😍😍😍😍awesome you are teacher who teachs every hard subjects in very short time with easiest way to learn them thanks
Wow. That's really regex in one hundred seconds. Respect to you
Thanks, loved this video😁
Keep up the great videos!
Had to teach myself regex for SRE/Observability. We wanted to report on Modules but aren’t capturing log data by Module. The FullURL contains the Module name at one point so we parse the FullURL string and cut everything that comes before and after a certain part of the URL to get the data we need. Super fun to figure out
I love regex, it's such a handy and amazing tool
For anyone trying to practice, regex crosswords are a really good (and in my opinion fun) way to practice them
Nice video. Thanks!
i will google it when i need it ,thank you very much ;)
This does a fantastic job of explaining what regex is used for and its capabilities, in a nutshell. I recommend watching at 0.75x speed ;)
Holy heck I wish I had found this sooner would have saved me several hours
I'm addicted to this channel
This is really useful. Thanks
Great explanation!!
Honnestly, regexr is an absolute godsend.
The most I have learned about regex is from this video !!!
Took my theory of computation course 4 weeks to explain what I learned in less than 2 minutes! (granted, they went way more in-depth, but a lot of that knowledge isn't needed to be able to write regex)
This looks like a cool thing to learn
Cant leave your videos without liking
I swear I was searching how to use regex this morning and here we go!
Google should take from your example. Best ever.
Mark Text, a FOSS program for markdown has Regex, so I need to learn how to use it. Loving the concept of both markdown and Regex.
your 100 seconds are my favorite
Thank you!
Your videos are awesome just like this one, thanks for the uploads! just one minor suggestion, can you please reduce the background music so that the content is heard more, this is not an issue and I am not complaining. Thanks again for all the videos you do in this channel.
You video is so precise. I am someone already know regex from other language but don't know how to use it with JavaScript. I immediately kill it after watching your video.
I remember using Perl & it helps me remember regex better 😂
I feel I'll learn it really well after watching this video a few hundred more times
100 sec videos are easy and very valuable information....Please make video on (...SPREAD SYNTAX)
keep making awesome content!