Hi,
sorry for offtopic, but I’m getting mad with this regular expression…
I want to parse a PDF with UiPath. The PDF is a purchase order with different positions:
It looks like this
18 123456 25,00 Stck 100,00 2.500,00 EUR
.
.
.
some textIhre Art.-Nr. 1690431
Liefertermin: 21.11.2019
.
.
.
some textincl.Mindermengenzuschlag
entspricht: 222,00 EUR
the problem is that I need two optional groups the “Liefertermin” (delivery date) and the “Mindermengenzuschlag” (extra charge for small amounts) are optional
This is my RegEx so far:
\n1\s(\d{2,8})\s(\d{0,3}(.\d{3}),\d)\s(\w{1,10})\s(\d{0,3}(.\d{3}),\d)\s(\d{0,3}(.\d{3}),\d)\s(\w{3}).+?Ihre Art.-Nr.\s(\d+).+?(Liefertermin:\s(\d{2}.\d{2}.\d{4}))+?.+?(Mindermengenzuschlag.+?entspricht:\s(\d{0,3}(.\d{3}),\d)\s(\w{1,10}))+?
This doesn’t work if the optional values are not there - of course
imo it shoul go like this:
\n1\s(\d{2,8})\s(\d{0,3}(.\d{3}),\d)\s(\w{1,10})\s(\d{0,3}(.\d{3}),\d)\s(\d{0,3}(.\d{3}),\d)\s(\w{3}).+?Ihre Art.-Nr.\s(\d+).+?(Liefertermin:\s(\d{2}.\d{2}.\d{4}))?.+?(Mindermengenzuschlag.+?entspricht:\s(\d{0,3}(.\d{3}),\d)\s(\w{1,10}))?
but then it doen’t match the optional values at all…
Can anyone help?