Regex to find a exact word from string

Hi,
I want to find exact match word “SFDR” from below string through regex or any other way.

Could you please help investigate why below fund has no SFDR tag while the prospectus is in 2022 and according to MIFID is ESG Characteristics (art 8).

pls help me out in this

Hi @sshitol

You can try with Regular expression

System.Text.RegularExpressions.Regex.Match(YourString,"\bSFDR\b").Tostring

Regards
Gokul

HI,

What result do you need?

Return SFDR if exists.

System.Text.RegularExpressions.Regex.Match(yourString,"\bSFDR\b").Value

Return true or false

System.Text.RegularExpressions.Regex.IsMatch(yourString,"\bSFDR\b")

Regards,

system.text.Regularexpression.Regex.match(yourstringvariable,“[A-Z]*(?= tag)”)

You can try this

[A-Z]+(?<=SFDR)

Cheers,

1 Like

Hi @sshitol

I have attached an image of Regex expressions. Check it below

System.Text.RegularExpressions.Regex.Matches(yourstringinput.ToString,“((?<=\s)[A-Z]{4}(?=\s))”)

Hope it helps!!