updated solution styled as code block (#34266)

This commit is contained in:
Nemanja Jeremic
2018-11-13 08:24:33 +01:00
committed by Aman Mittal
parent cf65516cce
commit f0ce844ca0

View File

@ -1,18 +1,16 @@
--- ---
title: Match All Letters and Numbers title: Match All Letters and Numbers
--- ---
The Problem ## The Problem
Use the shorthand character class \w to count the number of alphanumeric characters in various quotes and strings. Use the shorthand character class \w to count the number of alphanumeric characters in various quotes and strings.
Solution
let quoteSample = "The five boxing wizards jump quickly."; ## Solution
```let quoteSample = "The five boxing wizards jump quickly.";
let alphabetRegexV2 = /\w/gi; // Change this line let alphabetRegexV2 = /\w/gi; // Change this line
let result = quoteSample.match(alphabetRegexV2).length; let result = quoteSample.match(alphabetRegexV2).length;
```
## Match All Letters and Numbers
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-all-letters-and-numbers/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds --> <!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->