From 696eda5d02c1c72d7a8b82de0f6660b88a1cdadd Mon Sep 17 00:00:00 2001 From: Kuthumi Pepple Date: Tue, 3 Mar 2020 23:20:19 +0100 Subject: [PATCH] fix typo Number should be 79031234567 not 79035419441 --- 9-regular-expressions/02-regexp-character-classes/article.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/9-regular-expressions/02-regexp-character-classes/article.md b/9-regular-expressions/02-regexp-character-classes/article.md index dbf93287..7baa6984 100644 --- a/9-regular-expressions/02-regexp-character-classes/article.md +++ b/9-regular-expressions/02-regexp-character-classes/article.md @@ -1,6 +1,6 @@ # Character classes -Consider a practical task -- we have a phone number like `"+7(903)-123-45-67"`, and we need to turn it into pure numbers: `79035419441`. +Consider a practical task -- we have a phone number like `"+7(903)-123-45-67"`, and we need to turn it into pure numbers: `79031234567`. To do so, we can find and remove anything that's not a number. Character classes can help with that. @@ -30,7 +30,7 @@ let regexp = /\d/g; alert( str.match(regexp) ); // array of matches: 7,9,0,3,1,2,3,4,5,6,7 // let's make the digits-only phone number of them: -alert( str.match(regexp).join('') ); // 79035419441 +alert( str.match(regexp).join('') ); // 79031234567 ``` That was a character class for digits. There are other character classes as well.