String manupulation expression to get the specific string

Hi Guys
so my scenario is ill receiving a mail which body =

Details:
• Additional Backup Folder File Count : 0
• S3 Additional Backup Folder File Count : 0

Request to be sent for restore: ::{‘s3_backup_location’: ‘s3://aws-a0122-use1-00-s-bbbr-bing-rdmp-bck05/EMR_Backup_New/EMR_bak_189/data/backup_20220708-102932’, ‘key’: ‘XXXXXXXXX’, ‘host’: ‘10.000.05.000’, ‘recipient’: ‘comma separated mail-ids’}
Note: key has been masked for security reasons

This email body will change for the new emails.

So my question is- I need to get the specific string that is ( s3://aws-a0122-use1-00-s-bbbr-bing-rdmp-bck05/EMR_Backup_New/EMR_bak_189/data/backup_0708-102932)

so how to get this value every time

Please let me the solution

Thanks alot

Hey @Jiban_Kumar_Das_TcM ,

As you string is the json string so better to use the deserialization of json and get the value corresponding to the required key.
Have a look on the below thread.

Thanks,
Sanjit

You can use regular expressions to select specific data

System.Text.RegularExpressions.Regex.Match( StrTextData,“/(?<={‘)([\S\s]*?)(?=’})/gm”).ToString

Hey, this is not a Json string,
I have tried your method

So either string manipulation(preferred) or reggex will work

Hey thanks fr the input
Let me give it a try
It will always get me the newer values as well right ?

& btw do you know the alternative solution using string manipulation?

I just tested, this regex isn’t working

Moreover, u could the entire string is highlighted

But as I have mentioned I need only a specific piece from that string I,e "S3 backup location’=

s3://aws-a0122-use1-00-s-bbbr-bing-rdmp-bck05/EMR_Backup_New/EMR_bak_189/data/backup_20220708-102932

Hi @Jiban_Kumar_Das_TcM ,welcome to our community.
Try this regex expression: (?<={)([\S\s]*?)(?=…key)
I think you will get your desired output.

image

Thanks & Regards,
Shubham Dutta

See

Still not working

Do you have Any alternatives like string manipulation?

Hi @Jiban_Kumar_Das_TcM ,
I think I you are doing something wrong, I am getting the output you required please go through the code I am attaching.
Main.xaml (5.4 KB)

Do check the input_str in code.

Thanks & Regards,
Shubham Dutta

Hey i just checked its working, but with an issue

& that is when this string is changing(which is obvious for each run)

its not giving me the exact string i.e only “s3 backup path’s value only”

I just ran it with a different S3 backup file path, & this time the path was bigger

so it couldn’t get the entire path

Hi @Jiban_Kumar_Das_TcM ,
please provide me few sample strings.

Actually in the current code you will get the path before ‘key:’, so in every scenario you will get the entire path which is before ‘key:’


I get it
But , see this time it pulled a few further letters

1 more humble request, I’m not so into Regex expression
so can you can you please get me a string manipulation alternative

& thank you so much for your input in this thread