Extract specific part of a string

Hi there,

I’m looking for a solution for how to extract a specific part of a string:

string1 = “A.DVD-S, Test, Temp”
string2 = "Test, “A.DVD-S, Temp”

I want to extract the entire “A.DVD-S” part from both strings.

Hi @Niko_Don-Ho
please try this one by one on your strings
use assign activity left side put string variable
and right side put this expression →


Hi @Niko_Don-Ho ,

Could you give us some more details of the data/pattern of data that you would be receiving and help us to understand what is importance of that value ?

Are the other words Test and Temp constant throughout your data and would there be only three words separated by commas.

More description/Detail would help us to identify the logic.

Do you mean that you want to get the second of the three values that are separated by commas?

If so, just split on the comma and take the second element from the array (index 1).

Hi @Niko_Don-Ho ,

Welcome to the UiPath Forum.

Could you please define the exact criteria?

I understand that you want to extract A.DVD-S, but we usually check if the string contains what we are looking for before we extract it - also the string is usually dynamic.

Are you looking for a regex pattern to perform extraction or is the string that you are looking for fixed?
Then again, it depends on what the automation is being built to achieve.

imo this leads to a lot of unnecessary complexity which I’m really good at cooking up so here you go:




TestingRandomIdeas.xaml (4.6 KB)

Kind Regards,
Ashwin A.K

Hi @supermanPunch,
indeed there are other patterns that can occur.

“A.DVD” could also be “B.CD”
There is not always a comma in the string.
Sometimes there are more words, sometimes it is just one.

Im looking for a way to extract the word that is connected by the “.” in the word.

Hi @ashwin.ashok ,

I am looking for a way to extract the word that is connected by the “.”
A.DVD is not specific string I can look for because there are several similar strings that are connected by a “.” exp. “B.CD” or “D.DVD-S-W”

HI @postwick, not its not always in the second place, sometimes it can be in the first place or other place.

@Niko_Don-Ho ,

Maybe take a look at the below Expression and use Regex to extract the matching pattern value :


Expression :

System.Text.RegularExpressions.Regex.Match(YourInputVar, "\w+\.[a-zA-Z-]+").Value.ToString

If there are multiple word matches, we could replaced Match with Matches in the above expression and get all the matching words.

Let us know if this does not work and provide us a sample / instance where it fails.

1 Like

@supermanPunch Thank you for your help. Looking good so far. I will run some tests and come back.

1 Like

@Niko_Don-Ho are you try my solution?

@raja.arslankhan yes but it returned more strings than the one we are looking for, thank you!