How to find this string "PSinn-U Card Office #55215" this string contain in a paragraph. Note PSinn is constant

how to find this string “PSinn-U Card Office #55215” in paragraph. Note PSinn is constant

Hello @Sudheer_Sadhu, Welcome to UiPath Community
Try Regex Expression

System.Text.RegularExpressions.Regex.Match(YourString,"(?=PSinn).*(?<=#)\d+").ToString.Trim

Hi @Gokul_Jayakumar Thanks for your response
But Some times the string Contains # and number and some times it doesn’t contains.
Thanks.

Hi @Sudheer_Sadhu ,

Could you maybe check with the below Regex Expression :

(?=PSinn).+?\d+

Expression :

Regex.Match(YourInputString,"(?=PSinn).+?\d+").Value.ToString.Trim

Let us know if this is not what was required.

Hi @supermanPunch bro

My Question is some times the string looks like this ‘PSinn-U Card Office’ and some times
it’s look like this “PSinn-U Card Office #55215”. Could you please provide the regex that satisfy both conditions.

Thank’s

@Sudheer_Sadhu ,

We have an Enquiry from this statement. Do you have to just check if the sentence is present in the String or Do you want to extract the sentence ?

How many variations of the Sentence can be present ? Write now you have provided only two variations.