$1, $2 refers the capturing groups. $1 means first capturing group$2 means first capturing group…. etc.These are mainly used for replacement. Lets see an exampleWe…
We can explain our regular expression within the expression using comments. Syntax:(?#Commented Code) Suppose we have a two strings below:Hello worldhello World Regex to match…
(?<!…) is used to checks if any preceding character or pattern does not match the specified pattern.Syntax: (?<!preceedingPattern)patternLet’s see with example: We have some lines…
Suppose we have some lines below from where we just want to cut out ‘hello’ regardless of its case.Lines: fetch hello onlynot hello-worldavailable hellonot the…