I used a regular expression to find an invoice number in a PDF dataset by finding a specified numeric value and then retrieving the string that immediately follows it. When using regexr.com I am able to use my code to find the invoice number. I also tested the code within the matches activity in UiPath and the code returned the invoice number I was looking for. However when I am applying the regex formula into UiPath the result is blank. What am I doing wrong here?
change your regex to (?<=81-166-935)[\s]+(.*)
because when you read pdf/txt file the result might have multiple white space characters e.g.
a newline might be /r/n instead of /n so you need [\s]* instead of \s to handle that
Hello, @jack.chan !
I have the same problem as @JeffNZ1 - and I don’t know if the problem was ever solved. I’ve edited my code as you recommend, with the
Blockquote
because when you read pdf/txt file the result might have multiple white space characters e.g.
a newline might be /r/n instead of /n so you need [\s]* instead of \s to handle that
As @JeffNZ1, I’ve tested against several regex pages on the net, and as you can see, the Matches activity also returns the right output.
Nevertheless, the result turns out as blank.
Also checked this:
IEnumerable = Output
Output.Count.ToString returns 0 (zero).
Navn Live Hansen
Arbeidssted Østre Bergen kommune
Stilling Fysioterapeut
Adresse Sutrevegen 54 5050 Fana
Telefon 91111157
Treffes enklest Mand-fred 09-15
Hi, @prasath17, and thanks for helping me out.
I changed to brackets because this was the recommandation given in this thread. So this is not intentionally from my side, to be honest I’m not familiar with groups. Still learning. It was worth a go, tho.
Thanks, @prasath17 !
This did the trick. Unfortunately, I’m not the starter of this thread (from 2016 ), so I can’t mark your post as solution. This has to do it.