regular expression

  • 691 Views
  • Last Post 02 August 2018
  • Topic Is Solved
giulio posted this 01 August 2018

Hi,

from OCR i have this string:

No A0065019TN16 (A) FC-373RL

(B) 22.04.2016

(C.2.1) ROSSI

(C.2.2) OTTAVIO

NATO IL 13.0 5.1957 (ROSTTV57El3L378T)

A ROVERETO (TN)

(C.2.3) VIA SPR ' E' 30

ROVERETO (TN)

in the field Regular expression I put \(A\).*

the result is a null string.

any suggest ?
thanks

Order By: Standard | Newest | Votes
luigi.zurolo posted this 02 August 2018

Hi Giulio,

To be more clear the regexp field in Zone OCR and Barcode are both used to match or not the recognition (full match as Luca mentioned).

E.g. if the detected value matches the specified regexp then it gets returned otherwise skipped, reason why your variable is empty.

Luigi

luca.scarpati posted this 01 August 2018

Ciao Giulio,

 

more than welcome!

It's not possible with the regular expression, you need a script to do this.

As I wrote in the previous message the Regular Expression field in the Zone OCR "it was designed to find a targeted data selected"...so yes, to get a specific value from the zone you need a script.

 

Have a nice afternooncool!

Luca

giulio posted this 01 August 2018

ciao,

I probably did not explain myself ...

I would like to be able to extract the string "(A) FC-373RL"

this is not possible with regular expression ?

Do I have to use a script ?

Thanks again.

Giulio

 

luca.scarpati posted this 01 August 2018

Hi Giulio,

 

your RegEx works, but the regular expression field it was designed to find a targeted data selected not an entire sequenze because otherwise is advisable to use a script. In any case, to your regex condition must be valid all word in the selected area.
Try with this "full-text RegEx" : (.|\n)+\(A\)(.|\n)+

You can find more information about this also in our help / manual and for your RegEx test...I suggest you try this: https://regex101.com/ 

 

Best Regards,

Luca

 

Close