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…
The syntax to assign a name to a capture group is (?<captureGroupName>patternToMatch).Let’s see an example : // Javascript code var str = "My birth date…