I’m new to using RegEx and was looking for help to understand what I’m doing wrong.
Here’s the Regular Expression I created to extract the information around the description of each item from a PDF. However, I can’t share the actual PDF, so I included the text extracted in a doc.
What I don’t understand is why the information I capture on the site isn’t the same as what UiPath captures. Do I need to follow different rules? Am I facing this problem in the wrong way? Should I do it differently?
I have never created an automation like this, so I’m pretty much out of options in my mind.
Your Regular Expression also helped me, and I tried to use your suggestion. I do not understand the last part of the value you assigned for strValue, so I think that I’m doing something wrong because is giving me an error.
Sorry, my expression is localized for Japan. Backslash is displayed as Yen sign(¥) in Japan locale.
Can you try the following expression? (Please replace Yen sign with backslash)
I changed the Yen sign for a backslash and it worked. However, I’m only getting the values of Group 1. How can I retrieve the values of all the groups in the Regular expression? Not the whole expression in 1 cell but a cell/row for each group, so I can keep working on it to complete my task.
PD: As an idea, I tried something similar to what @Steven_McKeering suggested using a counter and the expression {currentItem(counter).Groups(1).ToString.Trim} in the Add Data Row Activity, but it is giving me this error:
In this case, it’s unnecessary to use counter. It will be {currentItem.Groups(1).ToString.Trim}
And it may be better to use Named Group of Regex such as (?<LINENUMBER[0-9]{1,3})\s*(?<PARTNO>[0-9A-Z]{3}\-[0-9A-Z]{4})\s*...... We can get each group like matchVar.Group("PARTNO").Value
I used the Regular Expression and then ran a For Each activity to add all the lines to my data table. Finally, I wrote it in an Excel file. I’m leaving below the expression I used.