2018-10-12 15:37:13 -04:00
---
title: Ignore Case While Matching
---
2019-07-24 00:59:27 -07:00
# Ignore Case While Matching
2018-10-12 15:37:13 -04:00
2019-07-24 00:59:27 -07:00
---
## Problem Explanation
2018-10-12 15:37:13 -04:00
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.
2019-07-24 00:59:27 -07:00
---
## Hints
### Hint 1
2018-10-12 15:37:13 -04:00
Modify the regex so that it detects "freeCodeCamp", "FREECODECAMP", and "FrEeCoDeCaMp". Maybe using the `i` flag might help?
2019-07-24 00:59:27 -07:00
---
## Solutions
< details > < summary > Solution 1 (Click to Show/Hide)< / summary >
2018-10-12 15:37:13 -04:00
```javascript
let myString = "freeCodeCamp";
2019-07-24 00:59:27 -07:00
let fccRegex = /freeCodeCamp/i;
2018-10-12 15:37:13 -04:00
let result = fccRegex.test(myString);
```
2019-07-24 00:59:27 -07:00
< / details >