Extract only middle word from a string


Hi guys,
i have a string below and I want to extract only “ON” from the string.
Can someone help in this.

1-8200 DIXIE RD


Hi @somya177,

Kindly check the example attached and let us know if it helps you.

Main.xaml (6.1 KB)



apart from Brampton,it can be any other city like Quebec BC L6T0C1
how will the BOT then pickup “BC” from it?..


Hi @somya177,

Also, please check this one and test it. It’s using Regex and the string on this example is also the same from your example.

Main.xaml (5.9 KB)


Please test the two .xaml files that I sent to you and let us know which one has solved most of your scenarios.

1 Like

thank you very much…it’s working…:slight_smile:

1 Like

so second one worked better but the concern is that currently the address is this, but i believe better approach would be to pick up “ON”,“BC”,“WB” from the last.
Because the last is the Pincode which will always be constant 6 letters and before the PINcode will always be this Province code of 2 letters and will always be the same.
Provincecode space Pincode.
So can’t we use any kind of substring and pick the province code from the last as their positioning will never change


Hi @somya177,

I totally agree with you and in order to achieve it you could use the following code:

matches.ToList(matches.ToList.Count -2).ToString


it needs to be in assign activity or after the ismatches activity?


After the IsMatches.

1 Like

ok…thank you very much…:slight_smile:

1 Like

How about this?
I just need the middle 10 digit number between WR and CTR.
can you please help in extracting this?



Sure, please check it below:

Main.xaml (5.8 KB)



Hi @somya177,

This is another way… Hope will help you,


1 Like