Ignore Case While Matching

Ignore Case While Matching
0

#1

Tell us what’s happening:
never mind

Your code so far

let myString = "freeCodeCamp";
let fccRegex = /FreeCodeCamp freeCodeCamp/; // Change this line
let result = fccRegex.test(myString);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/ignore-case-while-matching


#2

I’ve edited your post for readability. When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.


#3

Your regular expression checks if the string “FreeCodeCamp freeCodeCamp” is found in mystring. It The challenge mentioned you can use the i flag which will match what you put inside the / / regardless of case. Try to use the flag and rewrite the expression.


#4

Yeah this is no help at all …
like from what it seems the challenge is pretty easy to do,
just include the /i after the string however… something is broken.

Your code so far


let myString = "freeCodecamp";
let fccRegex = /myString/i; 
let result = fccRegex.test(myString);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3523.0 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/ignore-case-while-matching/