Regex returns only first instace of match

I am trying to process an invoice and I have 2 “Invoice Dates”. I am saving the return of regex expression into a IEnumerable type object of Match but it only returns first instance.

Here is the Regex which I am using

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

image

Accessing the dates via

invoice_date_line(0).ToString => This works
invoice_date_line(1).ToString => Error

Kindly help & TIA

2 Likes

Please try using the snippet below:

https://go.uipath.com/component/cfgi-regular-expressions-utility

Please let me know if you’re still running into the same issue.

Hi
welcome to uipath community

whenever we are trying to fetch the value from a text having multiple line then we need to enable this in the property panel of MATCHES activity
image

you were almost done
now it would work for sure

hope this would help you
Cheers @nick2logan

1 Like

Hi Palaniyappan,

Thanks I know its literally a rookie mistake. I tried your way but didnt work. I think its not capturing the second instance of the match. Look at the snip below

Thanks Chenderson but I do not have a situation where I can specify specific string to capture the date. My starting string is always “Invoice Date” but the trailing string could be anything (Its basically customer name which will change with every invoice). I don’t know why its not capturing the second instance. Is there some global setting I have to set ?

Hi,

I just wrote sample workflow as the following, and it seems to work well.

Main.xaml (7.8 KB)

Is there any difference from yours?

Regards,

Yoichi

1 Like

Thanks Yoichi It worked. I don’t know what I was doing wrong however your solution worked

1 Like

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