From 9eca14ac85bd84d679c8a602cd8a01f9bb60c64a Mon Sep 17 00:00:00 2001 From: Aakash Panchal <51417248+Aakash-Panchal27@users.noreply.github.com> Date: Sun, 16 Feb 2020 19:41:15 +0530 Subject: [PATCH] Update Regex_pending.md --- Akash Articles/Regex_pending.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Akash Articles/Regex_pending.md b/Akash Articles/Regex_pending.md index 4e88161..1d8b5e8 100644 --- a/Akash Articles/Regex_pending.md +++ b/Akash Articles/Regex_pending.md @@ -273,7 +273,7 @@ Predict the output of the following regex: **Note:** Now you may be thinking, what if we want to match characters like ***, ?, +, {, },** etc in the text. We will look at it shortly. Keep reading! -## Word Boundary Matchers +## Boundary Matchers Now, we will learn how to match pattern at specific positions, like before, after or between some characters. For this purpose we use special characters like `^`,`$`,`\b & \B`,`\A`,`\z & \Z`, which are known as anchors. @@ -319,7 +319,7 @@ Example using both `^` and `$`: -**Note:** **`\A` and `\z & \Z` are another anchors which are used to match at very start of input text and at very end of input text respectively. But it is not supported in Javascript. +**Note:** `\A` and `\z & \Z` are another anchors which are used to match at very start of input text and at very end of input text respectively. But it is not supported in Javascript. Predict the output of the following regex: @@ -358,7 +358,7 @@ Similarly, you can use other quantifiers. var pattern = /(\d{4})-(\d{2})-(\d{2})/g; // ^ ^ ^ - //group-no: 1 2 3 + //group-no: 1 2 3 var result = pattern.exec(str); @@ -388,7 +388,7 @@ Similarly, you can use other quantifiers. var pattern = /(\d{4})-(\d{2})-(\d{2})/g; // ^ ^ ^ - //group-no: 1 2 3 + //group-no: 1 2 3 // Data replacement var ans=str.replace(pattern, '$3-$2-$1');