Regular Expressions, Using the Test Method, freeCodeCamp's Learn Regex Challenges, 2020 Learn Regex

Channel:
Subscribers:
8,020
Published on ● Video Link: https://www.youtube.com/watch?v=GtX_Lbej_hU



Duration: 2:23
192 views
4


In this first lesson, in our mission regex journey, we learn about the test method regarding regular expressions. As discussed in the introduction video, a regex allows us to specify a pattern we are looking for. In this lesson, we create a test string that we call "'testStr". This string contains the text "freeCodeCamp". We then create our regex that we will like to search for, "/Code/". We save this within a variable called "testRegex". We then use the .test method to check our testRegex to see if it is contained within a string we specify, in this case, "testStr". If the pattern is contained within the string passed in, then the function will return true, otherwise, it will return false, indicating that the pattern was not found. In this case, it will return true, since the pattern "Code", is found within our string "freeCodeCamp".




Other Videos By We Will Code


2020-01-17Match Single Characters Not Specified, Regular Expression Lesson 2020, freeCodeCamp Tutorial
2020-01-11Match Numbers and Letters of the Alphabet, Free Regex Course, freeCodeCamp Learn Regular Expressions
2020-01-10Match Letters of the Alphabet, Regular Expression Patterns, freeCodeCamp Regexes Review
2020-01-08Match Single Character with Multiple Possibilities, freeCodeCamp Regex Concepts and Challenges
2020-01-07Match Anything with Wildcard Period, freeCodeCamp's Regex Tutorials 2020, Learn Regular Expressions
2020-01-06Find More Than the First Match, freeCodeCamp's Regexes Tutor, Regular Expression Help 2020
2020-01-04Extract Matches Using Regex, freeCodeCamp Regular Expression Help, Learn Regexes
2020-01-03Ignore Case While Matching, Regular Expressions with JS 2020 Tutorial
2020-01-03Match a Literal String with Different Possibilities, Learn Regexes on freeCodeCamp, Understanding JS
2020-01-02Match Literal Strings, Learn Regular Expressions on freeCodeCamp 2020, Learn JS for Beginners 2020
2019-12-31Regular Expressions, Using the Test Method, freeCodeCamp's Learn Regex Challenges, 2020 Learn Regex
2019-12-31Introduction to the Regular Expression Challenges, A Regex Tutorial for Beginners, Learn Regex 2020
2019-12-30Handle a Rejected Promise with catch, Learn ES6 on freeCodeCamp 2020
2019-12-26Handle a Fulfilled Promise with then, freeCodeCamp's ES6 Challenges
2019-12-23Complete a Promise with resolve and reject, freeCodeCamp's Learn ES6 Challenges
2019-12-22Create a Javascript Promise, freeCodeCamp's ES6 Challenges on freeCodeCamp
2019-12-22Import a Default Export, freeCodeCamp's ES6 Lessons and Explanations
2019-12-21Create an Export Fallback with export default, freeCodeCamp's ES6 JS Syntax
2019-12-21Use * to Import Everything from a File, freeCodeCamp
2019-12-21Reuse Javascript Code Using import, freeCodeCamp's ES6 Challenges, Javascript Help 2020
2019-12-20Use export to Share a Code Block, ES6 Challenges freeCodeCamp, WebDev Tutorials



Tags:
regex test
regex test method
testing a regex
the test method
js test method