From ad25c1f253b7ef93769146618a8a197c3af174a4 Mon Sep 17 00:00:00 2001 From: greggubarev Date: Tue, 16 Oct 2018 09:02:42 +0400 Subject: [PATCH] Javascript: Add hint to Match Everything But Letters and Numbers (#19240) * Javascript: Add hint to Match Everything But Letters and Numbers Add hint to Match Everything But Letters and Numbers (https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/match-everything-but-letters-and-numbers and https://guide.freecodecamp.org/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-everything-but-letters-and-numbers/) * Update index.md --- .../index.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/client/src/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-everything-but-letters-and-numbers/index.md b/client/src/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-everything-but-letters-and-numbers/index.md index c8cdc8467a..2f5fb94feb 100644 --- a/client/src/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-everything-but-letters-and-numbers/index.md +++ b/client/src/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-everything-but-letters-and-numbers/index.md @@ -1,10 +1,17 @@ +--- +title: Match Everything But Letters and Numbers --- -title: Match Everything But Letters and Numbers ---- + ## Match Everything But Letters and Numbers -This is a stub. Help our community expand it. +### Problem: -This quick style guide will help ensure your pull request gets accepted. +We need to use the shorthand character class \W to count the number of non-alphanumeric characters in various quotes and strings. - +### Solution: + +```js +let quoteSample = "The five boxing wizards jump quickly."; +let nonAlphabetRegex = /\W/gi; // Change this line +let result = quoteSample.match(nonAlphabetRegex).length; +```