I get error in regex in pattern panel (Error ERROR Validation Error Compiler error(s) encountered processing expression ""(?<=ocr_text":")(\d+\.\d+).*(?="}])"". End of expression expected. Image Extraction.xaml)

Error ERROR Validation Error Compiler error(s) encountered processing expression “”(?<=ocr_text":")(\d+.\d+).*(?="}])"".
End of expression expected. Image Extraction.xaml

I get an error when am using this code

(?<=ocr_text":")\d+.\d+

It’s working properly on the regex website

But in the uipath I get an error like what I mentioned in the above image

I hope I will get a replay from you

Thanks
Chethan P

@copy_writes

Try like below

"(?<=ocr_text"+"""+:+"""+")\d+.\d+"

1 Like

Its not selected anything

It is programming expression. Just paste it in the activity property of regex and it will work

image

its taken wrong value
image

@copy_writes - If you could share the text, I will share the different pattern…

1 Like

I need 14.50
[{“message”:“Success”,“input”:“image.jpg”,“prediction”:[{“label”:“Date”,“xmin”:309,“ymin”:111,“xmax”:459,“ymax”:137,“score”:0.9999906,“ocr_text”:“25/12/2009”},{“label”:“Total_Amount”,“xmin”:467,“ymin”:359,“xmax”:555,“ymax”:396,“score”:0.9993831,“ocr_text”:“14.50”}],“page”:0,“request_file_id”:"3b20ada2-465f-442b-b610-

@copy_writes - Can you please try this…

Regex Pattern link

1 Like

It’s working you miss .\

Can you please explain y I get that error and can you please explain that pattern

Thanks
Chethan P

Because double quotes we use to enclose the string and we need to add two more double quotes to take single one in the string.

1 Like

(?<=ocr_text.+)\d{1,}.\d{1,}(?=.})

Can you please explain y you use + after look behind if i use in https://regex101.com/ i get error

@copy_writes - If you use Regex101 then you have to click ECMA script on the Left…

I personally prefer Regexstrom tester because it was coded for vb.net and which is one uipath uses…

1 Like

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