--- id: 587d7db4367417b2b2512b91 title: Ignore Case While Matching challengeType: 1 forumTopicId: 301344 --- ## Description
Up until now, you've looked at regexes to do literal matches of strings. But sometimes, you might want to also match case differences. Case (or sometimes letter case) is the difference between uppercase letters and lowercase letters. Examples of uppercase are "A", "B", and "C". Examples of lowercase are "a", "b", and "c". You can match both cases using what is called a flag. There are other flags but here you'll focus on the flag that ignores case - the i flag. You can use it by appending it to the regex. An example of using this flag is /ignorecase/i. This regex can match the strings "ignorecase", "igNoreCase", and "IgnoreCase".
## Instructions
Write a regex fccRegex to match "freeCodeCamp", no matter its case. Your regex should not match any abbreviations or variations with spaces.
## Tests
```yml tests: - text: Your regex should match freeCodeCamp testString: assert(fccRegex.test('freeCodeCamp')); - text: Your regex should match FreeCodeCamp testString: assert(fccRegex.test('FreeCodeCamp')); - text: Your regex should match FreecodeCamp testString: assert(fccRegex.test('FreecodeCamp')); - text: Your regex should match FreeCodecamp testString: assert(fccRegex.test('FreeCodecamp')); - text: Your regex should not match Free Code Camp testString: assert(!fccRegex.test('Free Code Camp')); - text: Your regex should match FreeCOdeCamp testString: assert(fccRegex.test('FreeCOdeCamp')); - text: Your regex should not match FCC testString: assert(!fccRegex.test('FCC')); - text: Your regex should match FrEeCoDeCamp testString: assert(fccRegex.test('FrEeCoDeCamp')); - text: Your regex should match FrEeCodECamp testString: assert(fccRegex.test('FrEeCodECamp')); - text: Your regex should match FReeCodeCAmp testString: assert(fccRegex.test('FReeCodeCAmp')); ```
## Challenge Seed
```js let myString = "freeCodeCamp"; let fccRegex = /change/; // Change this line let result = fccRegex.test(myString); ```
## Solution
```js let myString = "freeCodeCamp"; let fccRegex = /freecodecamp/i; // Change this line let result = fccRegex.test(myString); ```