Javascript: edit hint (#19229)
This commit is contained in:
committed by
Jonathan Grah
parent
76881d4404
commit
086758250b
@ -1,12 +1,13 @@
|
||||
---
|
||||
title: Match Characters that Occur One or More Times
|
||||
---
|
||||
|
||||
## Match Characters that Occur One or More Times
|
||||
|
||||
## the problem:
|
||||
## Problem:
|
||||
You want to find matches when the letter s occurs one or more times in "Mississippi". Write a regex that uses the + sign.
|
||||
## the solution
|
||||
|
||||
## Solution:
|
||||
|
||||
```js
|
||||
let difficultSpelling = "Mississippi";
|
||||
let myRegex = /s+/g; // this is the solution
|
||||
let result = difficultSpelling.match(myRegex);
|
||||
```
|
||||
|
Reference in New Issue
Block a user