"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"
.
fccRegex
to match "freeCodeCamp"
, no matter its case. Your regex should not match any abbreviations or variations with spaces.
freeCodeCamp
testString: assert(fccRegex.test('freeCodeCamp'), 'Your regex should match freeCodeCamp
');
- text: Your regex should match FreeCodeCamp
testString: assert(fccRegex.test('FreeCodeCamp'), 'Your regex should match FreeCodeCamp
');
- text: Your regex should match FreecodeCamp
testString: assert(fccRegex.test('FreecodeCamp'), 'Your regex should match FreecodeCamp
');
- text: Your regex should match FreeCodecamp
testString: assert(fccRegex.test('FreeCodecamp'), 'Your regex should match FreeCodecamp
');
- text: Your regex should not match Free Code Camp
testString: assert(!fccRegex.test('Free Code Camp'), 'Your regex should not match Free Code Camp
');
- text: Your regex should match FreeCOdeCamp
testString: assert(fccRegex.test('FreeCOdeCamp'), 'Your regex should match FreeCOdeCamp
');
- text: Your regex should not match FCC
testString: assert(!fccRegex.test('FCC'), 'Your regex should not match FCC
');
- text: Your regex should match FrEeCoDeCamp
testString: assert(fccRegex.test('FrEeCoDeCamp'), 'Your regex should match FrEeCoDeCamp
');
- text: Your regex should match FrEeCodECamp
testString: assert(fccRegex.test('FrEeCodECamp'), 'Your regex should match FrEeCodECamp
');
- text: Your regex should match FReeCodeCAmp
testString: assert(fccRegex.test('FReeCodeCAmp'), 'Your regex should match FReeCodeCAmp
');
```