Regex Expression required

Hi,

From the below text I want to get the output as “FI_TV_APPROVER”

Summary: SOX SAP Request Grant
SAP | FI_TV_APPROVER |
SAP Security (PPW)

Kindly help with the Regex expression to get out as “FI_TV_APPROVER”

Thank you.
Pavan Patil

@Pavan_Patil
Try this Regex and let me know.

Hi @Pavan_Patil

Try using the following below regex expression:

(?<=\|\s)[A-Z](.*)(?=\s\|)

Hope it helps!!
Regards,

Hi @Pavan_Patil
Try this

I hope it helps!!

Hi @Pavan_Patil

Use the below regex expression to get the output.

System.Text.RegularExpressions.Regex.Matches(yourstringinput.ToString,“((?<=\s|\s).*(?=\s|))”)

image

Hope it helps!!

Hello @Pavan_Patil ,
Try any one of the below Regex conditions:

System.Text.RegularExpressions.Regex.Match(YourString,"(?<=SAP\s\W\s).*(?=\s\|)").tostring.Trim   ------> SAP as anchor

System.Text.RegularExpressions.Regex.Match(YourString,"(?<=\s\|\s).*(?=\s\|)").tostring.Trim -------> "|" symbol as anchor

System.Text.RegularExpressions.Regex.Match(YourString,"[A-Za-z]{2}_[A-Za-z]{2}_[A-Za-z]{2,10}").tostring.Trim    -----> Word count used as an anchor

Thank you It works!!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.