fix(guide): simplify directory structure

This commit is contained in:
Mrugesh Mohapatra
2018-10-16 21:26:13 +05:30
parent f989c28c52
commit da0df12ab7
35752 changed files with 0 additions and 317652 deletions

View File

@@ -0,0 +1,10 @@
---
title: Check for All or None
---
## Check for All or None
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/javascript-algorithms-and-data-structures/regular-expressions/check-for-all-or-none/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->

View File

@@ -0,0 +1,25 @@
---
title: Extract Matches
---
## Extract Matches
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
Using the `match()` method, you can extract parts of a string that match with your regular expression. In this challenge, you are extracting the word "coding" from the string provided.
## Hint 1:
Change your regex to detect the word "coding".
## Hint 2:
Did you call the `match()` method on the string?
## Spoiler Alert - Solution Ahead!
## Solution:
```javascript
let extractStr = "Extract the word 'coding' from this string.";
let codingRegex = /coding/;
let result = extractStr.match(codingRegex);
```

View File

@@ -0,0 +1,15 @@
---
title: Find Characters with Lazy Matching
---
## Find Characters with Lazy Matching
#### Challange:
Fix the regex `/<.*>/` to return the HTML tag `<h1>` and not the text `<h1>Winter is coming</h1>`. Remember the wildcard . in a regular expression matches any character.
#### Solution:
```js
let text = "<h1>Winter is coming</h1>";
let myRegex = /<h1>?/; // it's the answer!
let result = text.match(myRegex);
```

View File

@@ -0,0 +1,24 @@
---
title: Find More Than the First Match
---
## Find More Than the First Match
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
If you have multiple occurrences of your regex inside a string, you can get the `match()` function to detect all of them. Simply tag along the `g` flag at the end of your regex! That's what you're doing in this challenge.
## Hint 1:
Change the regex so that it detects the word "twinkle".
## Hint 2:
You can add multiple tags to a regex! For example, a regex that detects multiple occurrences, and detects regardless of case, can be structured like `gi` or `ig`.
## Spoiler Alert - Solution Ahead!
## Solution
```javascript
let twinkleStar = "Twinkle, twinkle, little star";
let starRegex = /twinkle/gi;
let result = twinkleStar.match(starRegex);
```

View File

@@ -0,0 +1,34 @@
---
title: Find One or More Criminals in a Hunt
---
## Find One or More Criminals in a Hunt
## The Problem
A group of criminals escaped from jail and ran away, but you don't know how many. However, you do know that they stay close together when they are around other people. You are responsible for finding all of the criminals at once.
Write a greedy regex that finds one or more criminals within a group of other people. A criminal is represented by the capital letter C.
### Hint 1:
Are you surrounding your regexp in slashes?
```javascript
let regexp = /t.[a-z]*t/;
```
### Hint 2:
Are you using the '+' flag in your regexp?
```javascript
let regexp = /E+/; // returns E, EE, EEE patterns
```
### Spoiler Warning - Solution Ahead
## Solution
```javascript
let crowd = 'P1P2P3P4P5P6CCCP7P8P9';
let reCriminals = /C+/; // Change this line
let matchedCriminals = crowd.match(reCriminals);
console.log(matchedCriminals);
```

View File

@@ -0,0 +1,21 @@
---
title: Ignore Case While Matching
---
## Ignore Case While Matching
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
When creating a regular expression, you might want to match parts of string that are same in spelling, but different in case. To do this, you add the `i` flag to the end of the regex. In this challenge, you are doing just that.
## Hint 1:
Modify the regex so that it detects "freeCodeCamp", "FREECODECAMP", and "FrEeCoDeCaMp". Maybe using the `i` flag might help?
## Spoiler Alert - Solution Ahead!
## Solution
```javascript
let myString = "freeCodeCamp";
let fccRegex = /freeCodeCamp/i;
let result = fccRegex.test(myString);
```

View File

@@ -0,0 +1,13 @@
---
title: Regular Expressions
---
## Regular Expressions
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/mathematics/quadratic-equations/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@@ -0,0 +1,21 @@
---
title: Match a Literal String with Different Possibilities
---
## Match a Literal String with Different Possibilities
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
Suppose you want to match many different words with your regular expression; using the `|` symbol, that becomes possible. In this challenge, you are using that symbol to identify four different pets hidden within strings!
## Hint 1:
Inside the string literal, place the pet names, each seperated by the `|` symbol.
## Spoiler Alert - Solution Ahead!
## Solution:
```javascriot
let petString = "James has a pet cat.";
let petRegex = /dog|cat|bird|fish/;
let result = petRegex.test(petString);
```

View File

@@ -0,0 +1,18 @@
---
title: Match All Letters and Numbers
---
The Problem
Use the shorthand character class \w to count the number of alphanumeric characters in various quotes and strings.
Solution
let quoteSample = "The five boxing wizards jump quickly.";
let alphabetRegexV2 = /\w/gi; // Change this line
let result = quoteSample.match(alphabetRegexV2).length;
## Match All Letters and Numbers
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-all-letters-and-numbers/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->

View File

@@ -0,0 +1,24 @@
---
title: Match All Non-Numbers
---
## Match All Non-Numbers
## Hint 1
* You should try using a global flag.
## Hint 2
* Try a shorthand character for non-digits characters.
# Spoiler Alert!! Solution Ahead!
## Solution
```javascript
let noNumRegex = /\D/g;
```
## Explanation
* The `\D` shorthand character is used to match non-digits characters, it has the same result as using `[^0-9]`;

View File

@@ -0,0 +1,24 @@
---
title: Match All Numbers
---
## Match All Numbers
## Hint 1
* A global flag will help you get through this challenge.
## Hint 2
* Try using a shorthand character for `d`igits.
# Spoiler Alert!! Solution Ahead!
## Solution
```javascript
let numRegex = /\d/g;
```
## Explanation
* The `\d` shorthand character is a shortcut for `[0-9]`, it search for any number between 0 and 9.

View File

@@ -0,0 +1,21 @@
---
title: Match Anything with Wildcard Period
---
## Match Anything with Wildcard Period
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
## Hint 1:
The dot `.` is the key in this challenge.
## Hint 2:
You should put the dot on the right position.
## Solution
```javascript
let exampleStr = "Let's have fun with regular expressions!";
let unRegex = /.un/; // Change this line
let result = unRegex.test(exampleStr);
```
## Explaination
The period `.` will be any one character so the strings "run", "sun", "fun" and "pun" have the same un charaters.

View File

@@ -0,0 +1,26 @@
---
title: Match Beginning String Patterns
---
## Match Beginning String Patterns
## The Problem
Use the caret character in a regex to find "Cal" only in the beginning of the string rickyAndCal.
### Hint 1:
Try surrounding your regexp in slashes
```javascript
let testExp = /^test/;
// returns true or false depending on whether test is found in the beginning of the string
```
### Hint 2:
Try using the '^' character caret outside of brackets as seen in the above example
### Spoiler Alert - Solution Ahead
## Solution
```javascript
let rickyAndCal = "Cal and Ricky both like racing.";
let calRegex = /^Cal/; // Change this line
let result = calRegex.test(rickyAndCal);
```

View File

@@ -0,0 +1,12 @@
---
title: Match Characters that Occur One or More Times
---
## Match Characters that Occur One or More Times
## the problem:
You want to find matches when the letter s occurs one or more times in "Mississippi". Write a regex that uses the + sign.
## the solution
let difficultSpelling = "Mississippi";
let myRegex = /s+/g; // this is the solution
let result = difficultSpelling.match(myRegex);

View File

@@ -0,0 +1,29 @@
---
title: Match Characters that Occur Zero or More Times
---
## Match Characters that Occur Zero or More Times
Any letter in a regex expression that is followed by a `*` does not have to occur in the string tested whereas any letter in a regex expression followed by a `+` must occur in a string at least once, as shown below,
```javascript
let phrase = "ba humbug";
let regexPlus = /bah+/;
let regexStar = /bah*/;
regexPlus.test(phrase); // returns false
regexStar.test(phrase); // returns true
```
Both allow for any number of occurrences of the same letter in a row, for example,
```javascript
let phrase = "wooooow look at that!";
let regexPlus = /wo+w/;
let regexStar = /wo*w/;
regexPlus.test(phrase); // returns true
regexStar.test(phrase); // returns true
```

View File

@@ -0,0 +1,10 @@
---
title: Match Ending String Patterns
---
## Match Ending String Patterns
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-ending-string-patterns/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->

View File

@@ -0,0 +1,10 @@
---
title: Match Everything But Letters and Numbers
---
## Match Everything But Letters and Numbers
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-everything-but-letters-and-numbers/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->

View File

@@ -0,0 +1,20 @@
---
title: Match Letters of the Alphabet
---
## Match Letters of the Alphabet
In this challenge, you're asked to match all of the letters of the alphabet within a given string. Not only are you matching/searching for these characters, but you're asked to extract them.
### Hint 1:
Remember that you're asked to extract the letters from the string -- this cannot be done with the .test() method because it returns True or False. In this case, we need to extract the actual result from the string using the .match() method.
### Hint 2:
Are you using the match() method character case flag with brackets? e.g. regExp = /[a-e]/ vs regExp = /a-e/. What this allows us to do is search through the string for any characters matching [a, b, c, ... e] using the shorthand notation /[a-e]/.
### Spoiler alert: Solution Ahead
## Solution
```javascript
let quoteSample = "The quick brown fox jumps over the lazy dog.";
let alphabetRegex = /[a-z]/ig; // Change this line
let result = quoteSample.match(alphabetRegex); // Change this line
```

View File

@@ -0,0 +1,23 @@
---
title: Match Literal Strings
---
## Match Literal Strings
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
This challenge is not any different from the previous; in this case though, you are learning that string literals are case-sensitive. That means, when you test to see if a string has a literal, it will search for the exact case (lower or upper) inside the string. You will learn how to find string literals regardless of their case, in an upcoming lesson.
In this challenge, you're finding Waldo...inside a string!
## Hint 1:
Change the line to have the correct string literal.
## Spoiler Alert - Solution Ahead!
## Solution:
```javascript
let waldoIsHiding = "Somewhere Waldo is hiding in this text.";
let waldoRegex = /Waldo/; // Change this line
let result = waldoRegex.test(waldoIsHiding);
```

View File

@@ -0,0 +1,10 @@
---
title: Match Non-Whitespace Characters
---
## Match Non-Whitespace Characters
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-non-whitespace-characters/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->

View File

@@ -0,0 +1,32 @@
---
title: Match Numbers and Letters of the Alphabet
---
## Match Numbers and Letters of the Alphabet
In this challenge, you are asked to return a collection of both numbers and letters extracted from a string. Our goal is to create a single regexp that captures the range of letters between h and s, and the numbers from 2 to 6.
### Hint 1:
Are you using the match() method? If so, then are you calling the method from the appropriate variable? i.e.
```javascript
let input_string = "The string you are testing on"
let yourRegExp = /[h-s]/;
let correct_result = input_string.match(yourRegExp); // passes - returns characters H to S
let incorrect_result = yourRegExp.match(input_string); // fails - .match() is not a function
```
### Hint 2:
Did you remember to enable the regexp flags such as "i" for ignoring case and "g" for retreiving multiple values? If so, then are you including both the character case match for numbers AND letters?
```javascript
let regexp = /[a-z1-100]/ig
// above code returns all characters from A to Z, along with all numbers from 1 to 100
// this includes the letter A and Z and the numbers 1 and 100
```
### Spoiler Alert - Solution Ahead
## Solution
```javascript
let quoteSample = "Blueberry 3.141592653s are delicious.";
let myRegex = /[h-s2-6]/ig; // Change this line
let result = quoteSample.match(myRegex); // Change this line
```

View File

@@ -0,0 +1,22 @@
---
title: Match Single Character with Multiple Possibilities
---
## Match Single Character with Multiple Possibilities
### Extract
Using the match() method, you can extract parts of a string that match with your regular expression. In this challenge, you are extracting the vowels "a, e, i, o, u" from a provided string.
### Hint 1:
Are you attempting to use the test() method? Remember this method only returns True or False -- we need to extract the vowels from the string.
### Hint 2:
Have you tried using the '[]' character case match without commas? i.e. [abcd] vs [a, b, c, d]
### Spoiler Alert - Solution Ahead!
## Solution
```javascript
let quoteSample = "Beware of bugs in the above code; I have only proved it correct, not tried it.";
let vowelRegex = /[aeiou]/ig; // Change this line
let result = quoteSample.match(vowelRegex); // Change this line
```

View File

@@ -0,0 +1,30 @@
---
title: Match Single Characters Not Specified
---
## Match Single Characters Not Specified
In this challenge, we are asked to return a collection of matches that are not exactly specified. Whereas previous regexp challenges would have you match within the character case [a-z], this challenge instead asks us to negate these matches using the caret character [^a-z]. Our goal then is to return a negated collection (non-matches) of letters that are not vowels nor numbers.
## Hint 1:
Did you remember to surround your regexp in both brackets and slashes?
```javascript
let exampleRegExp = /[^a-z]/;
```
If so, then double check you're adding the appropriate flags:
* i : Ignores upper and lower case from search/match
* g : Retrieves multiple values; default is set to return the first match it encounters
* ^ : Negates the matches following this flag
### Hint 2:
Be sure to check whether your number range is correct -- the challenge asks us to negate all numbers from 0-99. This can be done using the negate caret placed immediately after the first opening bracket of your regexp.
```javacsript
let numbersRegExp = /[^0-99]/ig;
```
### Spoiler Alert - Solution Ahead
## Solution
```javascript
let quoteSample = "3 blind mice.";
let myRegex = /[^aeiou^0-99]/ig; // Change this line
let result = quoteSample.match(myRegex); // Change this line
```

View File

@@ -0,0 +1,10 @@
---
title: Match Whitespace
---
## Match Whitespace
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-whitespace/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->

View File

@@ -0,0 +1,16 @@
---
title: Positive and Negative Lookahead
---
## Positive and Negative Lookahead
- Remeber to use 2 `lookaheads` to check the patterns in the string. The first `lookahead` is very similar to that given in the example - '(?=\w{3,6})' - only the `lower-number` 3 is too low for our test cases, and an `upper-number` is completely unneccesarry. This first `lookahead` is only used to find a string consisting of a certain amount of characters. A second `lookahead` must be used to check for consecutive numerical values at the end of the string.
- The second `lookahead` is also similar to that given in the example - `(?=\D*\d)` - however, this expression too must be modified to pass all test cases. Remember to specify the exact amount of numbers you want to appear at the end of the string.
## Solution :
```javascript
let sampleWord = "astronaut";
let pwRegex = /(?=\w{5,})(?=\D*\d{2})/;
let result = pwRegex.test(sampleWord);
```

View File

@@ -0,0 +1,21 @@
---
title: Remove Whitespace from Start and End
---
## Remove Whitespace from Start and End
To solve this challenge you simply have to create a regex string that matches any spaces at the beginning or at the end of the string.
## Hint 1:
Think of how you can select substrings at the beginning or end of a string.
## Hint 2:
Think of how you can select whitespace
## Spoiler Alert - Solution Ahead!
## Solution:
```javascript
let hello = " Hello, World! ";
let wsRegex = /^\s+|\s+$/g; // Change this line
let result = hello.replace(wsRegex, ''); // Change this line
```

View File

@@ -0,0 +1,26 @@
---
title: Restrict Possible Usernames
---
## Restrict Possible Usernames
## Solution:
```javascript
let username = "JackOfAllTrades";
let userCheck = /^[a-z]{2,}\d*$/i;
let result = userCheck.test(username);
```
## Explain:
1. The only numbers in the username have to be at the end. `\d$`
There can be zero or more of them at the end. `*`
```javascript
/\d*$/;
```
2. Username letters can be lowercase and uppercase. `i`
```javascript
/\d*$/i;
```
3. Usernames have to be at least two characters long. `{2,}`
A two-letter username can only use alphabet letter characters. `^[a-z]`
```javascript
/^[a-z]{2,}\d*$/i;
```

View File

@@ -0,0 +1,51 @@
---
title: Reuse Patterns Using Capture Groups
---
## Reuse Patterns Using Capture Group
## Hint 1:
Given code below:
```javascript
let testString = "test test test ";
let reRegex =/(test)\s\1/;
let result = reRegex.test(testString);
```
`result` will match only `test test` because `\1` in this example stands for the same text as most recently matched by the 1st capturing group `(test)`.
If we were to lierally translate the regex, it would look something like this:
```js
let re = /(test)\s\1;
let literalRe = /test\stest;
```
Both `rea` and `literalRe` would match the same thing.
## Hint 2:
Given the code below:
```javascript
let testString = "test test test ";
let reRegex =/(test)(\s)\1\2\1/;
let result = reRegex.test(testString);
```
will match whole `test test test` because:
`\1` repeats (test)
`\2` repeats (\s)
## Hint 3:
The code below:
```javascript
let testString = "test test test test test test";
let reRegex =/(test)(\s)\1\2\1/g;
let result = reRegex.test(testString);
```
because we used `\g`, our Regex doesn't return after first full match (`test test test`) and matched all repetitions.
## Spoiler Alert - Solution Ahead!
## Solution:
```javascript
let repeatNum = "42 42 42";
let reRegex = /^(\d+)\s\1\s\1$/;
let result = reRegex.test(repeatNum);
```

View File

@@ -0,0 +1,10 @@
---
title: Specify Exact Number of Matches
---
## Specify Exact Number of Matches
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/javascript-algorithms-and-data-structures/regular-expressions/specify-exact-number-of-matches/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->

View File

@@ -0,0 +1,18 @@
---
title: Specify Only the Lower Number of Matches
---
The Problem
Change the regex haRegex to match the word "Hazzah" only when it has four or more letter z's.
Solution
let haStr = "Hazzzzah";
let haRegex = /Haz{4,30}ah/; // Change this line
let result = haRegex.test(haStr);
## Specify Only the Lower Number of Matches
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/javascript-algorithms-and-data-structures/regular-expressions/specify-only-the-lower-number-of-matches/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->

View File

@@ -0,0 +1,28 @@
---
title: Specify Upper and Lower Number of Matches
---
## Specify Upper and Lower Number of Matches
Remember `/a{2,4}/` will return `true` as long as there are between two to four a's together. It will return `true` for any string that has more than four a's together as well.
All these strings will return `true`:
```javascript
let threeAs = "aaa";
let fourAs = "aaaa";
let sevenAs = "aaaaaaa";
let myRegex = /a{2,4}/;
myRegex.test(threeAs) ; // true
myRegex.test(fourAs) ; // true
myRegex.test(sevenAs) ; // true
```
## Spolier Alert!
Remember to use `\s` after `Oh{3,6}` to include a white space, followed by `no` to pass all test cases. All test cases are written using a capital O, however the testcases could also be passed by using `ignore-case` : `/oh{3,6}\sno/i`
## Solution:
```javascript
let ohStr = "Ohhh no";
let ohRegex = /Oh{3,6}\sno/; // Change this line
let result = ohRegex.test(ohStr);
```

View File

@@ -0,0 +1,22 @@
---
title: Use Capture Groups to Search and Replace
---
## Use Capture Groups to Search and Replace
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
Using `.replace()` with the first parameter set to find the part of the original string to replace, and the second parameter should be the replacement.
## Hint 1:
Modify the regex so that `fixRegex` detects the part of the string to replace and the variable `replaceText` should be modified to the string that will replace `fixRegex`.
## Spoiler Alert - Solution Ahead!
## Solution
```javascript
let huhText = "This sandwich is good.";
let fixRegex = /good/; // Change this line
let replaceText = "okey-dokey"; // Change this line
let result = huhText.replace(fixRegex, replaceText);
```

View File

@@ -0,0 +1,21 @@
---
title: Using the Test Method
---
## Using the Test Method
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
In this challenge, you are checking to see if a string contains a certain "regular expression", or **regex** (**reg**ular **ex**pressions). You will use the `test()` method to do that.
## Hint 1:
Call the test method on `myRegex`. What do you think the argument will be?
## Spoiler Alert - Solution Ahead!
## Solution
```javascript
let myString = "Hello, World!";
let myRegex = /Hello/;
let result = myRegex.test(myString); // Change this line
```