* chore(learn): audit basic algorithm scripting * chore(learn): audit basic data structures * chore(learn): audit basic javascript * chore(learn): audit debugging * chore(learn): audit es6 * chore(learn): audit functional programming * chore(learn): audit intermidate algorithms * chore(learn): audit js projects * chore(learn): audit object oriented programming * chore(learn): audit regex * fix(learn): remove stray . * fix(learn): string to code * fix(learn): missed some * fix(learn): clarify strings Based on Randy's feedback, clarifies string instances where quotes were removed in favour of back ticks. * fix: apply suggestions - thanks Randy! :) Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> * fix: non-suggestion comments * chore(learn): remove comments from codes Removes the comments from the description and instruction code blocks to ensure that all relevant information is translatable. * fix: Apply suggestions from code review Co-authored-by: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com> * fix: revert crowdin fix * Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations.md Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> * fix: Apply suggestions from code review Co-authored-by: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com> * Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-arrays.md Co-authored-by: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com> * fix: Apply suggestions from code review Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com> Co-authored-by: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com> * chore: change voice * fix: Christopher Nolan * fix: expressions would evaluate * fix: will -> would * Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/add-methods-after-inheritance.md Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> * fix: to work to push * Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-for-loops.md Co-authored-by: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com> * Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/add-methods-after-inheritance.md Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> Co-authored-by: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com> Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
64 lines
1.5 KiB
Markdown
64 lines
1.5 KiB
Markdown
---
|
|
id: 587d7db5367417b2b2512b97
|
|
title: Match Numbers and Letters of the Alphabet
|
|
challengeType: 1
|
|
forumTopicId: 301356
|
|
dashedName: match-numbers-and-letters-of-the-alphabet
|
|
---
|
|
|
|
# --description--
|
|
|
|
Using the hyphen (`-`) to match a range of characters is not limited to letters. It also works to match a range of numbers.
|
|
|
|
For example, `/[0-5]/` matches any number between `0` and `5`, including the `0` and `5`.
|
|
|
|
Also, it is possible to combine a range of letters and numbers in a single character set.
|
|
|
|
```js
|
|
let jennyStr = "Jenny8675309";
|
|
let myRegex = /[a-z0-9]/ig;
|
|
jennyStr.match(myRegex);
|
|
```
|
|
|
|
# --instructions--
|
|
|
|
Create a single regex that matches a range of letters between `h` and `s`, and a range of numbers between `2` and `6`. Remember to include the appropriate flags in the regex.
|
|
|
|
# --hints--
|
|
|
|
Your regex `myRegex` should match 17 items.
|
|
|
|
```js
|
|
assert(result.length == 17);
|
|
```
|
|
|
|
Your regex `myRegex` should use the global flag.
|
|
|
|
```js
|
|
assert(myRegex.flags.match(/g/).length == 1);
|
|
```
|
|
|
|
Your regex `myRegex` should use the case insensitive flag.
|
|
|
|
```js
|
|
assert(myRegex.flags.match(/i/).length == 1);
|
|
```
|
|
|
|
# --seed--
|
|
|
|
## --seed-contents--
|
|
|
|
```js
|
|
let quoteSample = "Blueberry 3.141592653s are delicious.";
|
|
let myRegex = /change/; // Change this line
|
|
let result = myRegex; // Change this line
|
|
```
|
|
|
|
# --solutions--
|
|
|
|
```js
|
|
let quoteSample = "Blueberry 3.141592653s are delicious.";
|
|
let myRegex = /[h-s2-6]/gi; // Change this line
|
|
let result = quoteSample.match(myRegex); // Change this line
|
|
```
|