34:48 For anyone confused why he didn't put a comma after the 2 for “two *or more*” it’s because it is in a lookahead: it only needs to see two digits and then it can stop looking because then we know there are at least two.
@kevinthomas6894 жыл бұрын
01:04 Using the Test Method 02:15 Match Literal Strings 02:57 Match a Literal String with Different Possibilities 03:46 Ignore Case While Matching 02:46 Extract Matches 05:33 Find More Than the First Match 07:16 Match Anything with Wildcard Period 08:54 Match Single Character with Multiple Possibilities 10:15 Match Letters of the Alphabet 11:04 Match Numbers and Letters of the Alphabet 12:15 Match Single Characters Not Specified 13:33 Match Characters that Occur One or More Times 14:19 Match Characters that Occur Zero or More Times 15:32 Find Characters with Lazy Matching 18:54 Find One or More Criminals in a Hunt 19:58 Match Beginning String Patterns 20:56 Match Ending String Patterns 21:39 Match All Letters and Numbers 22:47 Match Everything But Letters and Numbers 23:35 Match All Numbers 24:06 Match All Non-Numbers 24:40 Restrict Possible Usernames 27:28 Match White-space 27:56 Match Non-White-space Characters 28:26 Specify Upper and Lower Number of Matches 29:40 Specify Only the Lower Number of Matches 30:10 Specify Exact Number of Matches 30:46 Check for All or None 31:37 Positive and Negative Lookahead.....Check For Mixed Grouping of Characters 35:09 Reuse Patterns Using Capture Group 40:18 Use Capture Groups to Search and Replace 43:17 Remove Whitespace from Start and End
@JErock254 жыл бұрын
Oh, this made me so happy!!! Thanks a lot.
@kevinthomas6894 жыл бұрын
@@JErock25 .....😅
@hattorihanzo57073 жыл бұрын
GOD
@kevinthomas6894 жыл бұрын
*FOR REFERENCE :----* \f matches form-feed. matches carriage return. matches linefeed. \t matches horizontal tab. \v matches vertical tab. \0 matches NUL character. [\b] matches backspace. \s matches whitespace (short for [\f \t\v\u00A0\u2028\u2029] ). \S matches anything but a whitespace (short for [^\f \t\v\u00A0\u2028\u2029] ). \w matches any alphanumerical character (word characters) including underscore (short for [a-zA-Z0-9_] ). \W matches any non-word characters (short for [^a-zA-Z0-9_] ). \d matches any digit (short for [0-9] ). \D matches any non-digit (short for [^0-9] ). \b matches a word boundary (the position between a word and a space). \B matches a non-word boundary (short for [^\b] ). \cX matches a control character. E.g: \cm matches control-M . \xhh matches the character with two characters of hexadecimal code hh . \uhhhh matches the Unicode character with four characters of hexadecimal code hhhh .
@nullied Жыл бұрын
uhhhh thanks!
@dj10schannel10 ай бұрын
Thank you
@conaxliu96775 жыл бұрын
At 36:36, /(\w+)\s\1/ is actually not the same to /(\w+)\s\(\w+)/ When \1 is used, it enforces the same set of characters, so "regex regex" will match but "regex abcdefg" won't match. (Second word must be the same as the first word.) However, if use /(\w+)\s\(\w+)/ then a string containing any two different words seperated by a space will also match. So the purpose of using \1 is not just to save space.
@rakeshmali17273 жыл бұрын
Exactly!
@MohammadAlhef4 жыл бұрын
The Best Course in The World , Thank You From Syria Arab
@RedEyedJedi5 жыл бұрын
That was insanely helpful. Thank you so much Beau. I see 8 people don't have complete control over their mouse when clicking the like button.
@bmoffitt215 жыл бұрын
Didn't realize Jerry Seinfeld is getting into the RegEx game. Great course, thank you!!
@MukeshKumar-rh1rs4 жыл бұрын
Name 🙏🙏🙏🙏🙏
@oussama406123 жыл бұрын
Hahahahha
@faraza51613 жыл бұрын
Underrated comment
@Bobson_Dugnutt_Esq3 жыл бұрын
"What is the deal with regular expressions? Does this imply that there are irregular expressions? Maybe they just need more fiber in their diet."
@Greerbowski3 жыл бұрын
Don’t get me started on airline food!
@OliverWoodphotography5 жыл бұрын
This has helped me to understand htaccess URL rewrites
@roeltaga4 жыл бұрын
27:00 I think you missed something about the case when the username is longer than 2 characters. You made it so it has to start with two letters. I think the right regex would be this : /^[A-Za-z]{2,}\d*$|^[A-Za-z]\d{2,}$/ this checks is the username starts with at least 2 or more letters and then it allows you to have 0 or more numbers at the end. OR also checks if it starts with only one letter but has to have 2 or more numbers for it to be allowed.
@aditi_bscmathematics_3rdye7403 жыл бұрын
thank you!!! yeah i was also thinking this and then i read your comment.
@theCuriousCivilEngineer3 жыл бұрын
when you use {2,} it means at least two or more alphabets. so there is no problem with that
@MrBoiks2 жыл бұрын
spec says numbers aren't allowed if the name is only 2 characters.
@icaruz90942 жыл бұрын
WOOW YOU'RE HIRED!!!
@julioarruda81822 жыл бұрын
@@theCuriousCivilEngineer d88 should pass but it wont
@Jaybearno3 жыл бұрын
Step 1- learn regex Step 2- forget regex Step 3- realize you still need to know regex, frantically try combinations on regexr until you get what you need.
@discodilip20003 жыл бұрын
lolol I know this is True because I ended up on this video too
@JacobKinsley Жыл бұрын
I wish there was like, an "expanded" version of regex where instead of symbols and letters, it's words with some aliases for common things. Writing Regex is one of those things I really wish I never have to figure out ever again. Calling the expressions regular is like making a programming language and calling it "better programming language"
@conaxliu96775 жыл бұрын
When I come to Lookaheads at 31:38 it starts to get complicated and confusing. Take the positive lookahead example: let quit = "qu"; let quRegex = /q(?=u)/; quit.match(quRegex); So, quote from 32:29: "It's first going to check for the 'q', and it's going to look ahead to make sure there is an 'u' LATER in the string." If that statement is correct then I would expect the following also works: let quit = "quit fooling around"; let quRegex = /q(?=fool)/; quit.match(quRegex); I expected it to work because I am taking "later in the string" as anything between the 'q' and the end of the string. So if the string is "quit fooling around" then I expect /q(?=fool)/ will also match. However, this is not the case. The lookahead actually just check the pattern NEXT to the 'q'. So only these would match: /q(?=u)/; /q(?=uit)/; /q(?=[a-zA-z ]*fool)/; Does that make sense or have I misunderstood something?
@mariocardenas12595 жыл бұрын
Yes that's right, in order to do what you want to do you would have to use /q(?=.*fool)/
@VeedFeedАй бұрын
the best guide for regex!!!!!!!!!!!!!!!!!!!
@anyavailablehandle3 жыл бұрын
Great clear and concise teaching. Great video . Thanks
@HostDotPromo5 жыл бұрын
If regex was easy, I wouldnt be watching this 🔥 hard to remember how it works.
@nkplus5 жыл бұрын
Thanks Beau !! ---- Finally got !! which I was desperately waiting for ...
@conaxliu96775 жыл бұрын
All my life I felt like something was missing, until I found you.
@127.4 жыл бұрын
Corona, Corona... Be my Corona...
@yasam93115 жыл бұрын
This video is soo great. gives everything concisely. sincerely thank you!
@faronildomelancia24545 жыл бұрын
I'm brasilian and i love your channel.Congratulations!!
@ahmedhamed83245 жыл бұрын
Man!! they've must read my mind!
@TheSclare5 жыл бұрын
Finally someone is talking about this topic
@TechnoDB5 жыл бұрын
freeCodeCamp explanation is dope.. 😊
@PabloNevares5 жыл бұрын
I think there's an error in the video explaining capture groups. At 36:36 the author says that this: /(\w+)\s\1/ and this: /(\w+)\s(\w+)/ Would have been the same thing, just shorter due to using \1 to refer to the previous capture group. These are not the same regex patterns. The first example will test whether the second string is a repeat of the first. The second example will allow two different strings to pass the test. Try both with "regex regex" and "regex rerex" to see the difference.
@pnuematikon5 жыл бұрын
I noticed this too. Figured I'd see if there were any other comments before posting.
@conaxliu96775 жыл бұрын
Ha, I just commented on that, and then started to read other people's comments...
@ricardocambundo25273 жыл бұрын
This is a really good tutorial Got a deeper understanding of RegExp
@danhle79994 жыл бұрын
thank you for the explaination this is exactly what i am looking for
@rockybalboa10865 жыл бұрын
Very detailed and we'll put together!
@hammadurrehman38505 жыл бұрын
Well explained best video one can get on regex.
@gurunathrao29853 жыл бұрын
Regex is the criminal !
@pupfriend5 жыл бұрын
Little known fact. The guy who invented regex also invented water boarding
@LurajerLP5 жыл бұрын
For real??😂
@nicknamekenny5 жыл бұрын
Source?
@arnoldp89625 жыл бұрын
Meh, water boarding has been around since the catholic inquisition or earlier
@arunteltia78884 жыл бұрын
what is water boarding
@noelkirkland4 жыл бұрын
Haha, one guy says "source?" haha. I think what OP was saying is that learning regex is like torture.
@Bruno-ds8ze5 жыл бұрын
yeah!! i was waiting for this, thanyou very much
@JohnBartmannMusic3 жыл бұрын
35:00 "This is going to match for 5 or more characters". Noob question: doesn't the {5} mean it's going to match EXACTLY 5 characters?
@Z-7133 жыл бұрын
Yes! It does. {x,y} the x is the minimum, and the y is the maximum. {1,3} will match 1, 2, or 3. {5,} will match 5 OR MORE. {5} will match 5 EXACTLY. So, when the maximum is left blank ({x,}) it treats it as x OR MORE, and when the minimum and maximum don't exist ({x}) it treats it as x EXACTLY.
@JohnBartmannMusic3 жыл бұрын
@@Z-713 He says "this is going to match 5 or more characters" but the code will match exactly 5. The code reads {5} but his voiceover suggests that the code reads {5,}. Is there a mistake or am I missing something?
@Z-7133 жыл бұрын
@@JohnBartmannMusic Yes, you are correct. He did make a mistake in the video.
@theCuriousCivilEngineer3 жыл бұрын
@@JohnBartmannMusic it's because he is using it in a look ahead which means it will look through exactly "five" characters and is the code finds five character it will not care about the rest of the string.
@JohnBartmannMusic3 жыл бұрын
@@theCuriousCivilEngineer thank you
@JuanSB8273 жыл бұрын
I think at 36:40 there is mistake. He says that replacing \1 is just to avoid rewriting (\w+) However /(\w+)\s\1/ tests TRUE for "regex regex" but FALSE or "regex somethingelse" /(\w+)\s(\w+)/ tests TRUE for "regex regex" but TRUE for "regex somethingelse"
@dj10schannel10 ай бұрын
Man this was pretty darn good thanks beau 🙏
@Ali-vz9rs4 жыл бұрын
And another super useful video. Thank You freeCodeCamp.
@kefas4045 ай бұрын
thank you this was really helpful to get the basics
@rolandoriley2 жыл бұрын
Excelent course. .. thanks!
@mrzack1845 жыл бұрын
million thanks for this awesome video! it really taught me a lot.
@swapnilyadav7143 жыл бұрын
You guys are using Seinfeld vision from 30 Rock😁
@dhruva1675 жыл бұрын
Thanks for Great tutorial.
@abdullahfurkanozbek75585 жыл бұрын
I really consalidate my regex knowledge, thank you 😊
@WickedTwitches3 жыл бұрын
Be me, find a video, Beau is the narrator, leave understanding everything about rejects
@norflit3 жыл бұрын
the solution at 34:58 is not correct and the original challenge throws an error if I use 5 instead of 6 when testing string '12345'. let me know if this is a misunderstanding 🙂
@LevisRaju3 жыл бұрын
I think they improved the test cases now. Coz I got the same error
@rajeshsahu30735 жыл бұрын
For the username pattern challenge, I think you have missed the last point that says If there are only two letters then there should not be any number ?
@ntintelomazibuko97224 жыл бұрын
He specified at least 2 letters so it will work
@jachiu894 жыл бұрын
@@ntintelomazibuko9722 it's actually not working, I put the code he used and it's not passing because the regex won't match "Z97" since he used the {2,0} it needs at least the first two characters to be letters, it won't allow numbers.
@shankerm39594 жыл бұрын
I was looking out for that as well.
@roeltaga4 жыл бұрын
@@ntintelomazibuko9722 He made it so it has to start with 2 letters. But actually if the username is going to be longer than 2 characters needs to allow the 2nd one to be a number. I think the right regex would be /^[A-Za-z]{2,}\d*$|^[A-Za-z]\d{2,}$/
@ashutoshlohogaonkar83482 жыл бұрын
@@roeltaga Thanks man.. I was unable to pass one case of"Z97"
@chrikrah5 жыл бұрын
37:03 I don't think that /(\w+)\s\1/ is the same as /(\w+)\s(\w+)/ The former matches the exact same word again. So it would match "apple apple" but not "apple kiwi". Whereas the latter would match both "apple apple" and "apple kiwi". Correct me if I'm wrong.
@Martin-delta5 жыл бұрын
I was thinking the exact same thing. I think you are correct.
@cataxcab5 жыл бұрын
Is regex the same in Java?
@chrikrah5 жыл бұрын
@@cataxcab Unfortunately, there is no standard for regular expressions. There are a lot of overlaps and the basics are the same, but a lot of details differ. Checkout www.regular-expressions.info - it has a lot of information on the different flavors of Regex.
@fabrice98482 жыл бұрын
@22:00 He confused slash with backslash, frequent mistake.
@AbhishekKumar-mq1tt5 жыл бұрын
Thank u for this awesome video
@katieneko6742 жыл бұрын
how many times am I going to forget everything and come back to learn it again? Step by step is simple. putting it together is hard, and remembering what random letters do is simply not going to happen. Anyone got a way to memorize this or am I SOL?
@thuglife8965 жыл бұрын
Helpful as always Beau.
@bilalbeny4172 Жыл бұрын
thank u so much. it was an useful course.
@Blentux3 жыл бұрын
When I first got to do with Regex I hated it. Now that I begin to understand it, I'm kinda starting having fun lol
@shashishekhar----3 жыл бұрын
Thank you Beau , much appreciated thing !
@r1shabhnegi2 жыл бұрын
Thanks a lot Beau!
@qlevrqt8886 Жыл бұрын
in 18:36 I don't understand why the result wouldn't only be [""], why doesn't it stop once it sees the second bracket? Because technically "h1" is inside .
@rjse49054 жыл бұрын
Awesome explained. Thanks sir
@johnsonjayaraj7209 Жыл бұрын
Great video, thanks!!
@kostiantynkarzhanov92162 жыл бұрын
Beau, Thank you very much for this tutorial! It is great!
@germanduterte71104 жыл бұрын
Regular Expression is the most hardest part of all. It's easy to forget the rules and difficult to learn.
@jeneshnapit32485 жыл бұрын
What a coincidence I just got to regex like 10 mins ago. DM me if anyone looking to work on projects together.
@bafana_mhlamvu5 жыл бұрын
What level of coding knowledge are those projects catering for?
@jeneshnapit32485 жыл бұрын
@@bafana_mhlamvu I'd say begginner started learning JS a month ago know the basics and stuff but following the FCC JS at the moment. Can do DOM manipulation and have made a simple todo list.
@bafana_mhlamvu5 жыл бұрын
@@jeneshnapit3248Although relearning JavaScript, that sums my current level of the language... I'm interested in doing these projects...
@sandoxs5 жыл бұрын
First of all sorry my bad english...Wonderfull tutorial...just to mention...There's an error on 27:22 : about username restrictions...in the conditions it was mentioned that 2 letter usernames cannot have numbers after letters but actually it can...pls fix it
@conaxliu96775 жыл бұрын
I don't see the issue you described. What user name did you provide?
@rakibhossensarkar60802 ай бұрын
mindblowing
@darkriderofwest5 жыл бұрын
Very educational. Thanks a lot.
@johnlewis77364 жыл бұрын
Excellent. Thanks!
@VictorShirima-y2p Жыл бұрын
thank you its a good tutorial
@jvlensez Жыл бұрын
Hi Beau, 1. Which program are you using for the code in the video? 2. I really liked the mouse pointer, could you please share how I could get that on my PC?
@Webnoob5 жыл бұрын
Excellent tutorial. Thx.
@LHSgoatman3 жыл бұрын
Thanks for the video, but I think you are mistaken or misspoke on the reuse pattern using capture group. You stated that if you replace the \1 with the same capture pattern that it would be the same thing. I believe that is a mistake, for example use repeatstring. If you replaced the \1 with (\w+) then Yes it would match the string, but it would also match “regex testing” and I don’t think that is what you are trying to do.
@tonydanza45025 жыл бұрын
I guess specifying number of matches inside a look ahead uses different syntax than specifying number of matches not inside a look ahead? outside a look ahead {5} means exactly 5 but inside it means at minimum I take it?
@Noritoshi-r8m2 жыл бұрын
Great lecture, ty.
@darkcodelab5 жыл бұрын
Waiting for this!!!!!!
@MatheusPereira-nn9dj2 жыл бұрын
when we have this regexp information stored in variables , and from what I understand in the console they are in an array, can I use map() or filter() syntax?
@ajeetyadav40443 жыл бұрын
Thanks Beau;
@arthurserafim80665 жыл бұрын
Just got busted in a code test, so here am I!
@dr_morpho2 жыл бұрын
Thank you!))
@mikiaszerihun3681 Жыл бұрын
I think something went wrong on username validator regex. what do you think Mr Beau Carnes.
@emanuelmaza718 Жыл бұрын
En la parte de restricción de usuarios 24:40 solo me deja pasar el test utilizando la expresión /^[A-Za-z]{2,}\d*$ |^[A-Za-z]{1,}\d{2,}$/ si alguien encontró otra solución me la podría escribir en comentarios. At Restrict Possible Usernames 24:40 I'm able to pass the test with the expression /^[A-Za-z]{2,}\d*$ |^[A-Za-z]{1,}\d{2,}$/ Plz if there's any other solution can you write it in the comments.
@felixnoel88443 жыл бұрын
This is certainly an informative video however it is not a beginner's video due to how fast paced it is and the assumption that some prerequisite knowledge is present. In this case JavaScript. Nonetheless it is a good tutorial for people who want to refresh their knowledge on this particular area.
@Ddjfhfjfj2 жыл бұрын
10:07 Why aeiou in bracket don’t need comma ?
@whateveritwasitis11 ай бұрын
Wanted to thank you i hit this in class, lmao but I did it with my collar😂😂😂i knew something was wrong, still got it though
@LurajerLP5 жыл бұрын
Thank You 🤩
@leeboss3735 жыл бұрын
Why does I mean capitals and non capital? Why does g mean flag all? And how do you know this?
@kzakaria915 жыл бұрын
it's a standard thingy big boi, all programming languages has some kind of regular expression
@freecodecamp5 жыл бұрын
"g" stands for global match, "i" stands for ignore case
@leeboss3735 жыл бұрын
freeCodeCamp.org thanks👍🏻
@ttbtv62663 жыл бұрын
39:18 bruh what. Why would it match the space after the third '42' when the last element is any digits?
@souravsuman19935 жыл бұрын
5:28 what will happen if their is multiple match in a single line? Will it return array of matching strings?
@redps86115 жыл бұрын
i think just the first unless g is specified at the end of the regex..... right?
@conaxliu96775 жыл бұрын
@@redps8611 Right.
@emanuelmaza718 Жыл бұрын
En la parte de restricción de usuarios 24:40 solo me deja pasar el test utilizando la expresión /^[A-Za-z]{2,}\d*$ |^[A-Za-z]{1,}\d{2,}$/ si alguien encontró otra solución me la podría escribir en comentarios. At Restrict Possible Usernames 24:40 I'm able to pass the test with the expression /^[A-Za-z]{2,}\d*$ |^[A-Za-z]{1,}\d{2,}$/ Plz if there's any other solution can you write it in the comments.
@deepakbhargav74344 жыл бұрын
THANK YOU BOSS
@GemsofPakistan13 жыл бұрын
How to Find a regular expression that matches the last two columns of the file. ?
@СергейКрица3 жыл бұрын
35:07 regex doesn't work in case of less than 5 chars console.log(/(?=\w{5})(?=\D*\d{2})/.test("ast99")) and returns true.
@rakibhossensarkar60802 ай бұрын
awesome
@ttbtv62663 жыл бұрын
At 43:22, why doesn't /^(\s+)\1$/.test(' Hello, World! ') equal True? Can someone explain this to me pls?
@abdoemad69383 жыл бұрын
perfect !
@holo64333 жыл бұрын
Last task you can do without replace /[^\s].+[^\s]/
@harwinderthakur97085 жыл бұрын
Thanks
@ankitmehrotra85195 жыл бұрын
Beau ur name is sweet and so is ur way of explaining everything..Many thanks beau, ur awesome..😁😁👏👏🍻🍻
@younglonny22205 жыл бұрын
Beau is beautiful in french (masculine, belle is feminine)
@prashantsuryawanshi99305 жыл бұрын
Can you tell me , which code editor are you using?
@freecodecamp5 жыл бұрын
scrimba.com
@thesavagesalmon94645 жыл бұрын
use vscode
@orashusedmund7675 Жыл бұрын
in the username example you gave, how would we restrict Two-letter usernames from having numbers /^[A-Za-z]{2,}\d*$/ doesn't enforce this restriction
@GemsofPakistan13 жыл бұрын
How to Find a regular expression that matches the last two columns of the file. ? PLEASE HELP
@charlesludwig86723 жыл бұрын
Next, Adam Sandler should narrate functional programming
@rajeshprasadh37175 жыл бұрын
Sir do you have any course which can teach me about how to make dynamic graph using JavaScript I want to make one project for my college. In that I will compare 10 wealthiest people in the world between 1990 to 2019 Also we need to fetch data from another website for this project. Please help and reply
@freecodecamp5 жыл бұрын
Look into D3: kzbin.info/www/bejne/eWXXZ6Scfb9pitk
@AbdoMohamed-ml7ei3 жыл бұрын
at Restrict Possible Usernames 24:40 if the string is three characters (one letter and two numbers ) it will get false so the expression should be /^[A-Za-z]{2,}\d*$ |^[A-Za-z]{1,}\d{2,}$/ (WRONG ANSWER Check Kristof S comment)
@AbdoMohamed-ml7ei Жыл бұрын
yeah the two characters long spec i missed that. thank you
@cataxcab5 жыл бұрын
Hey, will I be able to use this in Java? I googled, it says lookbehind isn't supported in js, or something like that!
@XilvermistTrollawney3 жыл бұрын
33:50 I'm lost....
@seriousthing2405 жыл бұрын
Sir tell me webmethod
@viniciusra95845 жыл бұрын
Why not use comma instead of using let multiple times? instead of : let a = 0 let b = 1 let c = 2 let d = 3 use this: let a = 0, b = 1, c = 2, d = 3;
@OnyxBloodStone4 жыл бұрын
It's not gonna fit in a single line. Think about mobile viewers