.github
api-server
client
config
curriculum
docs
guide
arabic
chinese
english
3d
accessibility
agile
algorithms
android-development
angular
apache
aspnet
bash
blender
blockchain
bootstrap
bsd-os
bulma
c
canvas
certifications
apis-and-microservices
coding-interview-prep
data-visualization
front-end-libraries
information-security-and-quality-assurance
javascript-algorithms-and-data-structures
basic-algorithm-scripting
basic-data-structures
basic-javascript
debugging
es6
functional-programming
intermediate-algorithm-scripting
javascript-algorithms-and-data-structures-projects
object-oriented-programming
regular-expressions
check-for-all-or-none
check-for-mixed-grouping-of-characters
extract-matches
find-characters-with-lazy-matching
find-more-than-the-first-match
find-one-or-more-criminals-in-a-hunt
ignore-case-while-matching
index.md
match-a-literal-string-with-different-possibilities
match-all-letters-and-numbers
match-all-non-numbers
match-all-numbers
match-anything-with-wildcard-period
match-beginning-string-patterns
match-characters-that-occur-one-or-more-times
match-characters-that-occur-zero-or-more-times
match-ending-string-patterns
match-everything-but-letters-and-numbers
match-letters-of-the-alphabet
match-literal-strings
match-non-whitespace-characters
match-numbers-and-letters-of-the-alphabet
match-single-character-with-multiple-possibilities
match-single-characters-not-specified
match-whitespace
positive-and-negative-lookahead
remove-whitespace-from-start-and-end
restrict-possible-usernames
reuse-patterns-using-capture-groups
specify-exact-number-of-matches
specify-only-the-lower-number-of-matches
specify-upper-and-lower-number-of-matches
use-capture-groups-to-search-and-replace
using-the-test-method
index.md
index.md
responsive-web-design
index.md
chef
clojure
cloud-development
codeigniter
computational-genomics
computer-hardware
computer-science
containers
cplusplus
csharp
css
d3
data-science-tools
dc
design-patterns
designer-tools
developer-ethics
developer-tools
devops
dns
docker
documentation
drupal
electron
elixir
elm
erlang
fsharp
game-development
gatsbyjs
git
go
graphql
groovy
haskell
haxe
hibernate
html
ionic
java
javascript
joomla
jquery
julia
kotlin
laravel
linux
logic
machine-learning
mariadb
mathematics
meta
miscellaneous
mobile-app-development
mongodb
natural-language-processing
neovim
network-engineering
nginx
nodejs
optical-alignment
php
powershell
product-design
progressive-web-apps
puppet
python
r
raspberry-pi
react
react-native
redux
rest-api
robotics
rt-os
ruby
rust
sass
security
semantic-ui
software-engineering
sql
ssh
svg
svn
swift
tailwindcss
terminal-commandline
tomcat
tools
typescript
typography
user-experience-design
user-experience-research
vagrant
vim
virtualbox
visual-design
voice
vue
vue-cli
web-augmented-reality
web-components
web-performance
web-virtual-reality
wordpress
working-in-tech
xml
portuguese
russian
spanish
mock-guide
tools
.editorconfig
.eslintignore
.eslintrc.json
.gitattributes
.gitignore
.node-inspectorrc
.prettierrc
.snyk
.travis.yml
.vcmrc
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Dockerfile.tests
LICENSE.md
README.french.md
README.italian.md
README.md
azure-pipelines.yml
change_volumes_owner.sh
docker-compose-shared.yml
docker-compose.tests.yml
docker-compose.yml
lerna.json
libcimp_index_js.patch
package-lock.json
package.json
patch_npm_and_install.sh
sample.env
22 lines
737 B
Markdown
22 lines
737 B
Markdown
![]() |
---
|
||
|
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);
|
||
|
```
|