Hello
Need to extract the Ref ID No from below sample input. it will change dynamically
Invoice No: INV-12345
Ref ID = 67890
Transaction: TXN_45678
Hello
Need to extract the Ref ID No from below sample input. it will change dynamically
Invoice No: INV-12345
Ref ID = 67890
Transaction: TXN_45678
Hi paul,
Kindly check oput the below expression
Use this expression in the Assign activity
system.text.RegularExpression.regex.match(Inputstring,"(?<=Ref\sID\s\D\s)\d+").Tostring.Trim
Regards,
Gokul
Hi @Paul_Mark
Please find the below regular expression:
strInput = "Invoice No: INV-12345
Ref ID = 67890
Transaction: TXN_45678"
strOutput = System.Text.RegularExpressions.Regex.Match(strInput, "(?<=Ref ID\s*\=\s*).*").Value.Trim()
Hope it helps!!
Regards
PS Parvathy
Hi @Paul_Mark
Welcome to UiPath,
Try this-
refId = System.Text.RegularExpressions.Regex.Match(inputText, β(?i)ref\sid\s[:=]?\s*(\d+)β).Groups(1).Value
If helpful, mark as solution. Happy automation with UiPath
Hi @Paul_Mark
Welcome to UiPath community!
You can try to use linq functionality, use assign activity inside put
inputText.Split({Environment.NewLine},StringSplitOptions.RemoveEmptyEntries).Where(Function(x) x.Contains(βRef IDβ)).Select(Function(x) x.Split("="c)(1).Trim).First
Use if condition and you will get your required output. If you face any difficulties feel free to ping here .
Happy automation!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.