How to extract the ticket number from the String?

Hello, everyone. I’m looking to extract the ticket number from the string, but I want to exclude the date and time. Is there a way to achieve this?

String = "Ticket#4261 IP Info Requested By Malle Veeranjaneeyulu On Wed Sep 13 2023 22:51:46
"

Configure advanced as:

(?<=Ticket#)\d+

Just use System.Text.RegularExpressions.Regex.Match(yourStringVar,“(?<=Ticket# )(.*)(?= IP)”)

Could you please explain this logic ?

It would be greatly appreciated if you could explain this logic

Hi

This is the expression and explanation
Hope this helps


Cheers @Kumar_Sahu_Sameer

1 Like

in addition to above, then we need to Add .Value
grafik

Also have a look here:
[CheatSheet] - System.Text.RegularExpressions | RegEx - News / Tutorials - UiPath Community Forum

For getting some explanations on Regex we can use e.g. Regex101.com

We just want to look at the direct subsequent digits after the string Ticket#

1 Like

It’s just an expression. You can use it anywhere you need the value, like in an assign…

Assign ticketNum = System.Text.RegularExpressions.Regex.Match(yourStringVar,“(?<=Ticket# )(.*)(?= IP)”)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.