From a63839bae869f7193104369dd1fb668b784106d6 Mon Sep 17 00:00:00 2001 From: evabth <97984540+evabth@users.noreply.github.com> Date: Thu, 29 Jun 2023 16:14:38 -0400 Subject: [PATCH] Update 12_day_regular_expressions.md Updates Regular Expression code examples. The first code example using the special character 'd' is changed so that the desired outcome is elucidated, the second example explains what the + special character does --- 12_Day_Regular_expressions/12_day_regular_expressions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/12_Day_Regular_expressions/12_day_regular_expressions.md b/12_Day_Regular_expressions/12_day_regular_expressions.md index ef83882..7fdacd7 100644 --- a/12_Day_Regular_expressions/12_day_regular_expressions.md +++ b/12_Day_Regular_expressions/12_day_regular_expressions.md @@ -313,13 +313,13 @@ const pattern = /\d+/g // d is a special character which means digits const txt = 'This regular expression example was made in January 12, 2020.' const matches = txt. match(pattern) -console.log(matches) // ["12", "2020"], this is not what we want +console.log(matches) // ["12", "2020"], this is what we want ``` ### One or more times(+) ```js -const pattern = /\d+/g // d is a special character which means digits +const pattern = /\d+/g // + is a special character that matches one or more occurences of the preceding element const txt = 'This regular expression example was made in January 12, 2020.' const matches = txt. match(pattern) console.log(matches) // ["12", "2020"], this is not what we want