Extracting certain characters from the RE-Line Outlook email


Example re line in an email: ABCDEF ZYXWVU

This will read the first 6 characters.


Now how do I make uiPath to read the last 6 characters from the end of the re-line? i.e. ZYXWVU

Thank you in advance.



Re_Line.Trim.Substring(Re_Line.Length - 6)

1 Like


Thanks for that.

I just realised that there were some additional characters that needs to be skipped before grabbing the 6 digits I want.

The re line is as follows

Assigned to You: Test disc [102608 KIM]

I only want to grab 102608. Could you be so kind and give additional guidance.



Two ideas

a)Assigned to You: Test disc [102608 KIM]

Can we do get 6 characters after Square Bracket [ or is this string is for variable format?

b)Assigned to You: Test disc [102608 KIM]

Get the string between square brackets and substring 1st 6 Characters?

Your call.

The problem with a) is that “Test disc” will change depending on the user’s input.

I just also realised that “Kim” will change depending the client’s last name.

I guess I will have to try .

Now, how do I go about this…

Just realised that your example was a quotation marks. Tried that still the same.

Still no go.


It should be


No go. ARGH…

tempFileNum = Split(Re_Line,"[")(1)

File_Number= temFileNum.Substring(0,6)

I am sorry @vvaidya, but where…?

In you File_Number variable:

File_Number = Split(Re_Line,"[")(1).Substring(0,6)

Works beautifully.

Thank you so much. (and apologies for being such a noob).

File_Number = Split(Re_Line,"[")(1).Substring(0,6)

To understand the above, what should I study?

Again, thank you kindly.



This was actually the 1st idea we discussed in the above post. The second idea incase if you need in the future would be

Re_Line.Split((New Char() {"["C, "]"C}))(1).Substring(0,6) ----> This fetches 1st 6 characters in the square bracket

In addition to the substring and split, you could use Regex which is flexible for complex expressions.

To begin with: https://www.dotnetperls.com/split

1 Like


I am trying to extract string from brackets but facing trouble with extraction using query in rpa. For example: priyanka(priya)
want to extract priya from above line. How to do that using some query or vb script?