title
Regular Expressions (Regex) in JavaScript - tutorial

description
Learn the basics of using regular expressions / regex in your JavaScript applications. Check out Cody Seibert's main channel: https://www.youtube.com/channel/UCsrVDPJBYeXItETFHG0qzyw -- Learn to code for free and get a developer job: https://www.freecodecamp.com Read hundreds of articles on programming: https://medium.freecodecamp.com

detail
{'title': 'Regular Expressions (Regex) in JavaScript - tutorial', 'heatmap': [{'end': 162.719, 'start': 122.057, 'weight': 0.705}, {'end': 287.022, 'start': 257.805, 'weight': 0.98}, {'end': 556.777, 'start': 532.616, 'weight': 0.737}, {'end': 813.052, 'start': 768.789, 'weight': 0.717}], 'summary': 'Tutorial on regular expressions (regex) in javascript covers learning regex basics, testing, and character classes, regex pattern usage including plus, star, and question mark, ending characters, special characters like slash d, slash w, slash s, and grouping, and using regex to extract .mp3 file names. the content emphasizes the importance of practice and experimentation with different regex expressions for gaining a good understanding of string manipulation and matching.', 'chapters': [{'end': 415.091, 'segs': [{'end': 30.985, 'src': 'embed', 'start': 0.369, 'weight': 0, 'content': [{'end': 4.432, 'text': "Hey coders, I'm Cody, and welcome to learning the basics of regex in JavaScript.", 'start': 0.369, 'duration': 4.063}, {'end': 9.916, 'text': 'So to start off, what is regex, right? Regex is a way to match certain patterns inside of a string.', 'start': 4.892, 'duration': 5.024}, {'end': 16.2, 'text': 'So, for instance, if you have a string all your base are belonging to us and you want to test, does base exist in the string?', 'start': 10.216, 'duration': 5.984}, {'end': 17.041, 'text': 'you can do that with regex.', 'start': 16.2, 'duration': 0.841}, {'end': 23.22, 'text': "So just to show you that, I'll say all your base are belong to us.", 'start': 18.257, 'duration': 4.963}, {'end': 30.985, 'text': 'And if I want to test if base belongs in the string, I can just do the regex expression slash base slash end.', 'start': 23.921, 'duration': 7.064}], 'summary': 'Introduction to using regex in javascript to match patterns in strings.', 'duration': 30.616, 'max_score': 0.369, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/909NfO1St0A/pics/909NfO1St0A369.jpg'}, {'end': 77.81, 'src': 'embed', 'start': 45.902, 'weight': 2, 'content': [{'end': 49.705, 'text': 'and our test string, and you see that it highlights in blue, so we know that our regex passes.', 'start': 45.902, 'duration': 3.803}, {'end': 58.471, 'text': 'So how do you do this in JavaScript? Well, first of all, you want to declare a string called all your base, or belong to us.', 'start': 51.026, 'duration': 7.445}, {'end': 62.034, 'text': 'Secondly, you declare some type of regex expression.', 'start': 60.093, 'duration': 1.941}, {'end': 69.56, 'text': 'So we start that with a slash, a forward slash, type in your regex expression, base, and then end it with the following slash.', 'start': 62.114, 'duration': 7.446}, {'end': 77.81, 'text': 'And then lastly, if you wanted to test to see if base belongs in our string, we can say isExisting.', 'start': 70.666, 'duration': 7.144}], 'summary': "Javascript regex example: testing 'base' in 'all your base'", 'duration': 31.908, 'max_score': 45.902, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/909NfO1St0A/pics/909NfO1St0A45902.jpg'}, {'end': 165.001, 'src': 'heatmap', 'start': 109.328, 'weight': 1, 'content': [{'end': 111.23, 'text': "So again, that's the real basics.", 'start': 109.328, 'duration': 1.902}, {'end': 115.332, 'text': 'Just how do you test see if a certain substring exists in a larger string?', 'start': 111.49, 'duration': 3.842}, {'end': 121.056, 'text': "So we show that in regex101.com, and we're also showing it in JavaScript over here.", 'start': 116.193, 'duration': 4.863}, {'end': 126.6, 'text': "So now that we learned the basics of testing a string, let's go ahead and learn more complicated regex expressions.", 'start': 122.057, 'duration': 4.543}, {'end': 132.512, 'text': "So the first thing I'm going to cover is the carrot sign and the money sign.", 'start': 128.109, 'duration': 4.403}, {'end': 142.3, 'text': 'So the carrot is used to specify the start of the string has to match the reg expression followed by our string base,', 'start': 132.532, 'duration': 9.768}, {'end': 144.742, 'text': 'and the money sign is used for designating the end of our string.', 'start': 142.3, 'duration': 2.442}, {'end': 147.124, 'text': 'So what does that mean?', 'start': 146.523, 'duration': 0.601}, {'end': 152.127, 'text': "Basically, it means that our string has to be base, and that's it right?", 'start': 148.545, 'duration': 3.582}, {'end': 157.772, 'text': "So all your base are belonging to us, won't match, but if I change this to base, it passes.", 'start': 152.168, 'duration': 5.604}, {'end': 162.719, 'text': "Again, to demonstrate how you break that, I'll add an extra character called a.", 'start': 159.096, 'duration': 3.623}, {'end': 165.001, 'text': 'And notice that the money sign expression makes it fail.', 'start': 162.719, 'duration': 2.282}], 'summary': 'Learning basic and advanced regex expressions in javascript with examples.', 'duration': 55.673, 'max_score': 109.328, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/909NfO1St0A/pics/909NfO1St0A109328.jpg'}, {'end': 203.14, 'src': 'embed', 'start': 159.096, 'weight': 4, 'content': [{'end': 162.719, 'text': "Again, to demonstrate how you break that, I'll add an extra character called a.", 'start': 159.096, 'duration': 3.623}, {'end': 165.001, 'text': 'And notice that the money sign expression makes it fail.', 'start': 162.719, 'duration': 2.282}, {'end': 168.564, 'text': 'And if I were to remove the money sign, it passes again.', 'start': 165.822, 'duration': 2.742}, {'end': 179.493, 'text': 'And then again, to demonstrate the caret sign, this thing, it has to start with a base, right? So if I were to change this to z, this fails.', 'start': 170.346, 'duration': 9.147}, {'end': 182.476, 'text': 'And if I get rid of the caret, it passes again.', 'start': 179.713, 'duration': 2.763}, {'end': 187.125, 'text': "And again, I'm not going to show how to do this in JavaScript, because it's going to be the same.", 'start': 183.882, 'duration': 3.243}, {'end': 190.368, 'text': 'You are pretty much just going to copy and paste it in.', 'start': 187.225, 'duration': 3.143}, {'end': 191.689, 'text': "And that's how you do it.", 'start': 191.009, 'duration': 0.68}, {'end': 195.913, 'text': "So a lot of these examples, I'm going to stick to regex 101.", 'start': 191.89, 'duration': 4.023}, {'end': 199.297, 'text': 'OK, so we learned simple regex expressions for testing.', 'start': 195.913, 'duration': 3.384}, {'end': 203.14, 'text': 'We learned the caret sign, which means cert position at the startup string.', 'start': 199.877, 'duration': 3.263}], 'summary': 'Demonstrated regex expressions, including ^ and $. showed examples on testing.', 'duration': 44.044, 'max_score': 159.096, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/909NfO1St0A/pics/909NfO1St0A159096.jpg'}, {'end': 289.082, 'src': 'heatmap', 'start': 254.803, 'weight': 7, 'content': [{'end': 257.805, 'text': 'And notice that this will only match the first C.', 'start': 254.803, 'duration': 3.002}, {'end': 262.49, 'text': 'So with character classes, you need to add some additional options.', 'start': 257.805, 'duration': 4.685}, {'end': 265.112, 'text': 'So it can be one or more, which is a plus sign.', 'start': 262.55, 'duration': 2.562}, {'end': 268.875, 'text': 'It can be the star, which means zero or more.', 'start': 266.453, 'duration': 2.422}, {'end': 272.737, 'text': "There's a couple others like zero is optional.", 'start': 270.896, 'duration': 1.841}, {'end': 274.797, 'text': "You don't need to have the C.", 'start': 272.757, 'duration': 2.04}, {'end': 277.278, 'text': "And then we can also do, let's say we're checking for length.", 'start': 274.797, 'duration': 2.481}, {'end': 279.399, 'text': 'So we want it one to four characters.', 'start': 277.818, 'duration': 1.581}, {'end': 287.022, 'text': 'I can kind of go over those later on.', 'start': 285.441, 'duration': 1.581}, {'end': 289.082, 'text': "So let's just stick with the basics.", 'start': 287.062, 'duration': 2.02}], 'summary': 'Explaining character classes with quantifiable data and options for matching patterns.', 'duration': 34.279, 'max_score': 254.803, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/909NfO1St0A/pics/909NfO1St0A254803.jpg'}, {'end': 333.979, 'src': 'embed', 'start': 311.468, 'weight': 8, 'content': [{'end': 320.075, 'text': 'So, if I were to change this to age and then change the character class to zero through nine, one or more, again, any character that we add,', 'start': 311.468, 'duration': 8.607}, {'end': 322.738, 'text': 'which is a digit, should match this regex expression.', 'start': 320.075, 'duration': 2.663}, {'end': 326.241, 'text': "In the moment we change this to an A or B or C, it's gonna fail.", 'start': 323.779, 'duration': 2.462}, {'end': 333.979, 'text': 'So again, as a recap, we just covered character classes, which again is designated by these open brackets.', 'start': 327.455, 'duration': 6.524}], 'summary': 'Changing character class to digits enhances regex expression matching.', 'duration': 22.511, 'max_score': 311.468, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/909NfO1St0A/pics/909NfO1St0A311468.jpg'}, {'end': 420.693, 'src': 'embed', 'start': 391.865, 'weight': 3, 'content': [{'end': 394.426, 'text': "That'll pass.", 'start': 391.865, 'duration': 2.561}, {'end': 397.107, 'text': 'I mean, go crazy with this.', 'start': 394.446, 'duration': 2.661}, {'end': 398.488, 'text': 'Read some more documentation on this.', 'start': 397.227, 'duration': 1.261}, {'end': 402.709, 'text': "But again, we're just going to cover the basics of regex and using it in JavaScript.", 'start': 398.548, 'duration': 4.161}, {'end': 407.131, 'text': "We're going to dive deep into how to define more complicated character classes.", 'start': 403.19, 'duration': 3.941}, {'end': 415.091, 'text': 'So again, we covered testing a string for a substring, the caret, the money sign, character classes.', 'start': 408.232, 'duration': 6.859}, {'end': 420.693, 'text': 'We covered what the plus means, what the star means, which is zero or more.', 'start': 416.451, 'duration': 4.242}], 'summary': 'Basic regex in javascript, covering character classes, plus, star, and more', 'duration': 28.828, 'max_score': 391.865, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/909NfO1St0A/pics/909NfO1St0A391865.jpg'}], 'start': 0.369, 'title': 'Learning regex basics, testing, and character classes in javascript', 'summary': 'Introduces regex basics in javascript, covering pattern matching, testing, and output results. it also discusses testing substrings, caret and money signs functionality, and character classes usage with examples, showcasing the matching of names and ages.', 'chapters': [{'end': 106.967, 'start': 0.369, 'title': 'Learning regex basics in javascript', 'summary': 'Introduces the basics of regex in javascript, highlighting the use of regex to match patterns in a string, demonstrating how to test for the presence of a specific pattern, and explaining the process in javascript, with examples of testing and output results.', 'duration': 106.598, 'highlights': ['Regex is a way to match certain patterns inside of a string. Explains the purpose of regex in identifying specific patterns in a string.', 'Demonstrates how to test if a pattern exists in a string using regex. Illustrates the process of testing for the existence of a pattern within a string using regex.', 'Shows the process of testing and outputting results in JavaScript. Explains the steps involved in testing for pattern existence and displaying the results using JavaScript.']}, {'end': 225.038, 'start': 109.328, 'title': 'Regex basics and testing in javascript', 'summary': 'Covers the basics of testing substrings in a larger string using regex in javascript, including the caret and money signs, and demonstrates their functionality with examples. it also introduces the concept of ensuring specific substrings within a string.', 'duration': 115.71, 'highlights': ['The chapter covers the basics of testing substrings in a larger string using regex in JavaScript.', 'It introduces the functionality of the caret and money signs in regex expressions, demonstrating their impact on matching specific positions within the string.', 'Examples are provided to illustrate the behavior of the caret and money signs, showing how they affect the matching of string positions.', 'The chapter also introduces the concept of ensuring specific substrings within a string, using an example of ensuring the presence of a specific substring in a given string.']}, {'end': 415.091, 'start': 226.019, 'title': 'Regex character classes basics', 'summary': 'Covers the basics of using character classes in regex, including specifying ranges, adding quantifiers such as plus sign and star, and testing for specific lengths and patterns, with examples showing how to match names and ages using a-z characters and digits.', 'duration': 189.072, 'highlights': ['The chapter covers the basics of using character classes in regex. Explains the fundamentals of using character classes in regex to define patterns for matching specific sets of characters.', 'Specifying ranges and adding quantifiers such as plus sign and star. Describes how to define ranges of characters and add quantifiers like plus sign and star to specify the number of occurrences of the characters.', 'Examples showing how to match names and ages using A-Z characters and digits. Provides examples demonstrating how to use character classes to match names and ages using A-Z characters and digits, with explanations on the use of quantifiers and specifying specific lengths.']}], 'duration': 414.722, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/909NfO1St0A/pics/909NfO1St0A369.jpg', 'highlights': ['Explains the purpose of regex in identifying specific patterns in a string.', 'Illustrates the process of testing for the existence of a pattern within a string using regex.', 'Explains the steps involved in testing for pattern existence and displaying the results using JavaScript.', 'The chapter covers the basics of testing substrings in a larger string using regex in JavaScript.', 'Demonstrating their impact on matching specific positions within the string.', 'Examples are provided to illustrate the behavior of the caret and money signs.', 'Explains the fundamentals of using character classes in regex to define patterns for matching specific sets of characters.', 'Describes how to define ranges of characters and add quantifiers like plus sign and star to specify the number of occurrences of the characters.', 'Provides examples demonstrating how to use character classes to match names and ages using A-Z characters and digits.']}, {'end': 745.118, 'segs': [{'end': 482.487, 'src': 'embed', 'start': 416.451, 'weight': 1, 'content': [{'end': 420.693, 'text': 'We covered what the plus means, what the star means, which is zero or more.', 'start': 416.451, 'duration': 4.242}, {'end': 423.274, 'text': 'So again, this will pass if we have nothing.', 'start': 421.093, 'duration': 2.181}, {'end': 430.096, 'text': 'Could just add and, so zero or more characters.', 'start': 427.075, 'duration': 3.021}, {'end': 434.417, 'text': 'This will pass, this will pass, this will pass.', 'start': 430.736, 'duration': 3.681}, {'end': 440.519, 'text': "In fact, just to demonstrate this, let's get rid of the additional checks.", 'start': 436.598, 'duration': 3.921}, {'end': 447.42, 'text': "So this will fail because there's no character A through Z here.", 'start': 443.038, 'duration': 4.382}, {'end': 457.623, 'text': 'We can also use the question mark, which allows us an optional Y.', 'start': 448.26, 'duration': 9.363}, {'end': 464.665, 'text': 'So, for instance, if we said the Y is optional in my name, this will pass if I have Cody, or if I have COD,', 'start': 457.623, 'duration': 7.042}, {'end': 468.867, 'text': 'because the question mark represents an optional character.', 'start': 464.665, 'duration': 4.202}, {'end': 482.487, 'text': "then. lastly, i'm not sure if i just covered this, but if i wanted age to be three characters and only three characters,", 'start': 473.664, 'duration': 8.823}], 'summary': 'Covered regex operators: plus, star, and question mark for matching characters; demonstrated with examples.', 'duration': 66.036, 'max_score': 416.451, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/909NfO1St0A/pics/909NfO1St0A416451.jpg'}, {'end': 556.777, 'src': 'heatmap', 'start': 504.038, 'weight': 0, 'content': [{'end': 514.582, 'text': 'So if you wanted to explicitly end the string, so if I wanted to end the character or end the string, we can just end it with the money sign.', 'start': 504.038, 'duration': 10.544}, {'end': 523.065, 'text': 'And the last thing, if we just wanted to check that it has one character or one digit in it, we could just add one, right? So age is one.', 'start': 515.522, 'duration': 7.543}, {'end': 532.616, 'text': "So, now that we covered character classes, let's cover a couple of special characters that we can use in register expressions which allow us to.", 'start': 526.112, 'duration': 6.504}, {'end': 540.901, 'text': 'instead of having to write the character class 0 through 9, we can instead just do slash d.', 'start': 532.616, 'duration': 8.285}, {'end': 545.945, 'text': 'So slash d plus means match one or more arbitrary strings of digits.', 'start': 540.901, 'duration': 5.044}, {'end': 547.866, 'text': 'Slash d stands for digits.', 'start': 546.625, 'duration': 1.241}, {'end': 556.777, 'text': 'If I do name is, I can do dash slash W, which kind of matches just like a name.', 'start': 549.492, 'duration': 7.285}], 'summary': 'Using special characters like $ and \\\\d for string manipulation and validation.', 'duration': 43.828, 'max_score': 504.038, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/909NfO1St0A/pics/909NfO1St0A504038.jpg'}, {'end': 661.078, 'src': 'embed', 'start': 625.933, 'weight': 4, 'content': [{'end': 632.486, 'text': 'And what grouping allows you to do is in the code, we can say, give me match index 1.', 'start': 625.933, 'duration': 6.553}, {'end': 635.867, 'text': 'And we can set that into a variable, print that out, or do whatever we want.', 'start': 632.486, 'duration': 3.381}, {'end': 644.351, 'text': 'So in JavaScript, how do we actually do that? Again, we can change string to this.', 'start': 636.508, 'duration': 7.843}, {'end': 645.211, 'text': 'My name is Cody.', 'start': 644.531, 'duration': 0.68}, {'end': 649.213, 'text': 'The regex will be the exact same as what we saw here.', 'start': 646.532, 'duration': 2.681}, {'end': 661.078, 'text': 'And now what we can do instead of using the method test, so instead of regex.test, we do regex.excc for execute on the string.', 'start': 649.233, 'duration': 11.845}], 'summary': "Grouping in code allows accessing match index 1, print or use it. in javascript, change string to 'my name is cody' and use regex.exec instead of regex.test.", 'duration': 35.145, 'max_score': 625.933, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/909NfO1St0A/pics/909NfO1St0A625933.jpg'}], 'start': 416.451, 'title': 'Regular expressions', 'summary': 'Covers regex pattern usage including plus, star, and question mark, character classes, and ending characters, and special characters slash d, slash w, slash s, and grouping, with code demonstrations and examples.', 'chapters': [{'end': 523.065, 'start': 416.451, 'title': 'Regex pattern and its usage', 'summary': 'Discusses the usage of plus, star, question mark, character classes, and ending characters in regex patterns, demonstrating their functionalities with examples.', 'duration': 106.614, 'highlights': ['The star and plus symbols indicate zero or more and one or more occurrences respectively, allowing flexibility in matching patterns.', 'The question mark represents an optional character, providing versatility in pattern matching.', 'The usage of character classes with constraints, such as specifying a range and a quantifier, allows for precise pattern matching.', 'Ending the string with the money sign ensures explicit termination of the pattern, and adding a digit as a qualifier can check for specific character or digit presence.']}, {'end': 745.118, 'start': 526.112, 'title': 'Regex special characters and grouping', 'summary': 'Covers the use of special characters such as slash d, slash w, slash s, and grouping in regular expressions for pattern matching and extraction, with examples and code demonstrations.', 'duration': 219.006, 'highlights': ['The use of special characters such as slash d, slash W, and slash S allows for pattern matching of digits, word characters, and spaces, respectively, simplifying regular expressions.', 'Grouping in regular expressions allows for the extraction and use of specific matched patterns in the code, demonstrated through JavaScript code examples with match index manipulation.', 'The demonstration of using regex.exec instead of regex.test and accessing match index 1 to extract and store the matched pattern in a variable, enabling practical application of grouping in regular expressions.', 'The explanation and demonstration of how grouping in regular expressions can be used to extract and store specific patterns, as shown through JavaScript code examples with different name inputs and their resulting matches.']}], 'duration': 328.667, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/909NfO1St0A/pics/909NfO1St0A416451.jpg', 'highlights': ['The usage of character classes with constraints allows for precise pattern matching.', 'The star and plus symbols indicate zero or more and one or more occurrences respectively, allowing flexibility in matching patterns.', 'The question mark represents an optional character, providing versatility in pattern matching.', 'Ending the string with the money sign ensures explicit termination of the pattern, and adding a digit as a qualifier can check for specific character or digit presence.', 'Grouping in regular expressions allows for the extraction and use of specific matched patterns in the code, demonstrated through JavaScript code examples with match index manipulation.', 'The demonstration of using regex.exec instead of regex.test and accessing match index 1 to extract and store the matched pattern in a variable, enabling practical application of grouping in regular expressions.', 'The explanation and demonstration of how grouping in regular expressions can be used to extract and store specific patterns, as shown through JavaScript code examples with different name inputs and their resulting matches.', 'The use of special characters such as slash d, slash W, and slash S allows for pattern matching of digits, word characters, and spaces, respectively, simplifying regular expressions.']}, {'end': 1034.257, 'segs': [{'end': 845.421, 'src': 'heatmap', 'start': 768.789, 'weight': 0, 'content': [{'end': 778.227, 'text': 'If we wanted to take apart the string and find everything which matches .mp3, and just grab the grouping of the file name, we can do so like this.', 'start': 768.789, 'duration': 9.438}, {'end': 790.996, 'text': "So again, we're testing for .mp3, so slash d, mp3, and then we want global.", 'start': 780.408, 'duration': 10.588}, {'end': 795.479, 'text': "So in this case, we're going to have to add a global flag here to match anything in the string.", 'start': 791.216, 'duration': 4.263}, {'end': 799.362, 'text': "Because without the global flag, it just matches the first instance, and that's it.", 'start': 796.6, 'duration': 2.762}, {'end': 807.669, 'text': "And then let's say the file name is anyword, like so.", 'start': 802.185, 'duration': 5.484}, {'end': 813.052, 'text': "And we need to extract that, so let's go ahead and add a grouping on it.", 'start': 809.49, 'duration': 3.562}, {'end': 820.637, 'text': 'So again, this regex gives us any file which matches .mp3 at the end, and it also gives us the group of the name.', 'start': 814.173, 'duration': 6.464}, {'end': 828.482, 'text': "So to use this in JavaScript, let's go ahead and change string up here to our list of file names.", 'start': 822.198, 'duration': 6.284}, {'end': 830.944, 'text': "Let's update our regex here.", 'start': 829.823, 'duration': 1.121}, {'end': 840.439, 'text': 'to be any slash word, one or more, followed by mp3, and then set that to a global.', 'start': 832.216, 'duration': 8.223}, {'end': 845.421, 'text': 'Then we execute that regex on our string like we did before.', 'start': 842.74, 'duration': 2.681}], 'summary': 'Extract file names ending with .mp3 using regex in javascript.', 'duration': 65.013, 'max_score': 768.789, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/909NfO1St0A/pics/909NfO1St0A768789.jpg'}, {'end': 960.619, 'src': 'embed', 'start': 933.327, 'weight': 3, 'content': [{'end': 938.733, 'text': 'We learned how to test regex against a string to see if something exists in it.', 'start': 933.327, 'duration': 5.406}, {'end': 944.812, 'text': 'And then we also test how to use groupings to extract certain data from the regex.', 'start': 939.81, 'duration': 5.002}, {'end': 949.034, 'text': 'So again, I can go on and on with all the different, you know, special cases of regex.', 'start': 945.392, 'duration': 3.642}, {'end': 960.619, 'text': 'But I think what the best thing you should do is just keep on trying new things like think in your head of different string examples or real life scenarios in which you need to extract certain things from a string,', 'start': 949.494, 'duration': 11.125}], 'summary': 'Learned testing regex, using groupings to extract data, and exploring special cases. encouraged to practice with different string examples and real-life scenarios.', 'duration': 27.292, 'max_score': 933.327, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/909NfO1St0A/pics/909NfO1St0A933327.jpg'}, {'end': 1028.536, 'src': 'embed', 'start': 989.574, 'weight': 4, 'content': [{'end': 996.941, 'text': 'So, as long as you have a good understanding of how to write your regex expressions, you can translate the JavaScript Python Ruby Bash.', 'start': 989.574, 'duration': 7.367}, {'end': 998.803, 'text': 'whatever you want, you can translate regex to', 'start': 996.941, 'duration': 1.862}, {'end': 1003.607, 'text': 'And it really helps you out down the road if you need to do some type of string manipulation or string matching.', 'start': 999.363, 'duration': 4.244}, {'end': 1009.473, 'text': 'I think that kind of wraps up how to use the basics of regex in JavaScript.', 'start': 1004.828, 'duration': 4.645}, {'end': 1016.293, 'text': 'And again, find other resources if you want a more deep, detailed information about regex.', 'start': 1011.272, 'duration': 5.021}, {'end': 1023.515, 'text': "But I think that's a general overview of how to use regex in JavaScript to get most of the things you're trying to do accomplished,", 'start': 1016.353, 'duration': 7.162}, {'end': 1024.255, 'text': 'at least for beginners.', 'start': 1023.515, 'duration': 0.74}, {'end': 1028.536, 'text': 'Remember to subscribe and like if you thought this tutorial was pretty good.', 'start': 1025.615, 'duration': 2.921}], 'summary': 'Understanding regex allows translation to javascript python ruby bash for string manipulation and matching.', 'duration': 38.962, 'max_score': 989.574, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/909NfO1St0A/pics/909NfO1St0A989574.jpg'}], 'start': 745.158, 'title': 'Using regex to extract .mp3 file names and basics of regex in javascript', 'summary': 'Discusses using regex to extract file names ending with .mp3, covering the basics of using regex in javascript, including testing regex against a string, using groupings to extract data, and utilizing regex flags. it emphasizes the importance of practice and experimentation with different regex expressions to gain a good understanding of string manipulation and matching.', 'chapters': [{'end': 845.421, 'start': 745.158, 'title': 'Extracting .mp3 file names using regex', 'summary': 'Discusses using regex to extract file names ending with .mp3 from a string of file names, demonstrating the use of global flag and grouping.', 'duration': 100.263, 'highlights': ['Using regex to find and extract file names ending with .mp3 from a string of file names, utilizing the global flag to match all instances.', 'Demonstrating the addition of grouping to the regex to extract the file names ending with .mp3.', 'Explaining the need for a global flag in the regex to match all instances of file names ending with .mp3.']}, {'end': 1034.257, 'start': 846.182, 'title': 'Basics of regex in javascript', 'summary': 'Covers the basics of using regex in javascript, including testing regex against a string, using groupings to extract data, and utilizing regex flags. it emphasizes the importance of practice and experimentation with different regex expressions to gain a good understanding of string manipulation and matching.', 'duration': 188.075, 'highlights': ['The chapter emphasizes the importance of practice and experimentation with different regex expressions to gain a good understanding of string manipulation and matching. The tutorial suggests practicing and experimenting with different regex expressions to understand string manipulation and matching effectively.', 'It covers the basics of using regex in JavaScript, including testing regex against a string and using groupings to extract certain data from the regex. The chapter covers the basics of using regex in JavaScript, such as testing regex against a string and using groupings to extract certain data from the regex.', 'The tutorial mentions the ability to translate regex from JavaScript to other programming languages, emphasizing its universal applicability. It emphasizes the universal applicability of regex and the ability to translate regex from JavaScript to other programming languages.']}], 'duration': 289.099, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/909NfO1St0A/pics/909NfO1St0A745158.jpg', 'highlights': ['Using regex to find and extract file names ending with .mp3 from a string, utilizing the global flag to match all instances.', 'Demonstrating the addition of grouping to the regex to extract the file names ending with .mp3.', 'Explaining the need for a global flag in the regex to match all instances of file names ending with .mp3.', 'The chapter emphasizes the importance of practice and experimentation with different regex expressions to gain a good understanding of string manipulation and matching.', 'It covers the basics of using regex in JavaScript, including testing regex against a string and using groupings to extract certain data from the regex.', 'The tutorial mentions the ability to translate regex from JavaScript to other programming languages, emphasizing its universal applicability.']}], 'highlights': ['The chapter emphasizes the importance of practice and experimentation with different regex expressions to gain a good understanding of string manipulation and matching.', 'Using regex to find and extract file names ending with .mp3 from a string, utilizing the global flag to match all instances.', 'The demonstration of using regex.exec instead of regex.test and accessing match index 1 to extract and store the matched pattern in a variable, enabling practical application of grouping in regular expressions.', 'The usage of character classes with constraints allows for precise pattern matching.', 'Explains the purpose of regex in identifying specific patterns in a string.']}