Split with Multiple Delimiters

Hi,

I am new to UiPath. In a txt file, I have the below and want to extract “345” for variable Chr_D
Variable Sale Price Customer_ID
GH_E 199 32 456
Chr_D 100 12 345***

I tried the below. But i can’t seem to 1) add the 2nd delimiter (*), and 2) how do I extract not the last string but “345”? Thank you!

Cust_ID=(System.Text.RegularExpressions.Regex.Match(Result,“(?<=Cust_ID ).+”).Value).ToString.Split({" "C, “*”}).last

I solved it with

(System.Text.RegularExpressions.Regex.Match(Result,“(?<=Chr_D ).+”).Value).ToString.Split({" “C,”*"C})(2)

Hi
Hope this expression would help you resolve this either only with regex

Stroutput = System.Text.RegularExpressions.Regex.Match(strinput.ToString,”(?<=Chr_D)*(\s…\d)(?=[^\s])”).ToString.Trim

Cheers @Anonymous2

Hi

(System.Text.RegularExpressions.Regex.Match(Result,“(?<=Chr_D ).+”).Value).ToString.Split({" “C,”*"C})(2)

What if there are 5 spaces instead of 1?
Thanks

I didn’t get this buddy
Can I have an input example
Cheers @Anonymous2

Hi,
I mean there are 5 spaces between the numbers instead of 1. Oddly, I am unable to add 5 spaces in the below example. Thank you

Variable Sale Price Customer_ID
GH_E 199 32 456
Chr_D 100 12 345***

Did we try with this in that case
(?<=Chr_D)*\s…\d{3}+(?=[^\s])

Cheers @Anonymous2