Regex Extraction Text

Hello, I would like to help you, So you in this case the output should be
Item: Various
Description: Paper Supliers
Currency : USD
Right?

And Also do want each of them in a differet variable?

thank you so much but output will be
item description : Various paper supplies
Currency : USD
but it will be dynamically changes not fixed text but the same formula

You want the Total or Price amount??

no only Currency like USD EUR

@Mohamed_Hassan1 - In the given text, it’s on 3 places…so let us know which one you want exactly??

any one of them

@Mohamed_Hassan1 - Please check this…

 StrDescrption = System.text.regularexpressions.regex.matches(yourtext,"?<=Total\r?\n)(.+)\s+\d+\s+\d+\s+([A-z]{3})")(0).groups(1).tostring

 Strcurrency = System.text.regularexpressions.regex.matches(yourtext,"?<=Total\r?\n)(.+)\s+\d+\s+\d+\s+([A-z]{3})")(0).groups(2).tostring

For your reference

https://regex101.com/r/ScQugt/1/

Hope this helps…

thank you if i want only Various paper supplies in variable and currency USD in variable what the regex

that’s what I provided…check $1 and $2…which groups1 and groups2…

how can i used in uipath sequence

I gave the 2 assign statements, all you have to do is just copy and paste and run…for more on how to use Regex…please refer this page here…

i am sorry but how can i assign it

Apologize…Just adjusted the code…please refer above…

Here StrOutputN is string variable.

I share with you anothe Expresion
str_Currency = System.Text.Regularexpressions.Regex.Match(str_Text,"(?<=Subtotal:\s(\d+\s)).+").tostring
str_Description = System.Text.Regularexpressions.Regex.Match(str_Text,"(?<=Total\n).+(?=\s\d?\s)").tostring

Try to use it and let me know if that works


how to get the output text

Instead of .Matches it’s just .Match
System.Text.Regularexpressions.Regex.Match(str_Text,"(?<=Subtotal:\s(\d+\s)).+").tostring

@Mohamed_Hassan1 - looks like your input text might be different than what you have provided…can you please show your assign statement?

Let me know if those Expression worked