From 16108a37a462613121f27e719d379fabc79031a9 Mon Sep 17 00:00:00 2001 From: Saurabh Kushwah Date: Thu, 26 Mar 2020 08:12:21 +0530 Subject: [PATCH] Improve grammar and Added Example in 4. Lookarounds --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4ac6e0f9..637dc3ad 100644 --- a/README.md +++ b/README.md @@ -348,7 +348,6 @@ character.
 "(f|c|m)at\.?" => The fat cat sat on the mat.
 
- [Test the regular expression](https://regex101.com/r/DOc5Nu/1) ## 2.8 Anchors @@ -420,7 +419,7 @@ regular expressions: Lookbehinds and lookaheads (also called lookarounds) are specific types of ***non-capturing groups*** (used to match a pattern but without including it in the matching -list). Lookarounds are used when we a pattern must be +list). Lookarounds are used when want to check if a pattern is preceded or followed by another pattern. For example, imagine we want to get all numbers that are preceded by the `$` character from the string `$4.44 and $10.88`. We will use the following regular expression `(?<=\$)[0-9\.]*` @@ -428,6 +427,10 @@ which means: get all the numbers which contain the `.` character and are precede by the `$` character. These are the lookarounds that are used in regular expressions: +
+"(?<=\$)[0-9.]*" => The prices of monitors vary from $10.88 to $4.44 
+
+ |Symbol|Description| |:----:|----| |?=|Positive Lookahead|