Segregating 5 digit alpha numeric values with the field

Hi, I am extracting a field from PDF which has a value like “8A878” or “3 products of 8A878” or “8A878x14 x2” or “from the below attachmentt the value should be 8A878and 8AB78” or “it should be 8A878 with 5 quantity of 8AB78”.

There might be lots of patterns which it may come, but With all these patterns the field i need to retrieve should be this 5 digit alpha numeric value : 8A878 and 8AB78. Is there any way to do it?

Note : 8A878 and 8AB78 are just examples, the 5 digit value can be any number or alpha numeric.

Have a check if this regex pattern matches your data

@ppr - It didn’t work. I gave String as “83420x2quantity” and tried with string “6787A GO IV”. it didnt work with both of the strings.

I have used System.Text.RegularExpressions.Regex.Replace(str_variable,“[A-Z,\d]{5}”,“”). let me know if anything to be corrected.


so should it find it as in the second screenshot or what should be the match result of:
Input:
83420x2quantity
6787A GO IV
Output?

thats right, would need as per your second screenshot. but it isnt working this way in uipath flow.

@ppr - never mind, it got worked, i used diff regex.replace my bad. it should be regex.match().value. Thanks.

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