You are viewing limited content. For full access, please sign in.

Question

Question

Quick Fields - Custom Character Preference with an exception

asked on June 11, 2015
 

I need to apply a regular expression to collect Legal Addresses (ie, NE-10-045-14-4) in a specific Zone OCR area for a multi-value field, but not collect any lines that start with the word FARM (FARMLAND; FARM RESIDENCES, FARM RES EXMP, etc). Can you help? I already have the regular expression for the actual addresses collecting fine:

\w{1,2}-\d{2}-\d{3}-\d{2}-\d|\w{1,2}-\d{2}-\d{3}-\d{2}-\w\d

I just need to know how to add the part for the exception in the Custom Character Preference space.

Also wondering:  Using the code shown above, shouldn't QF's already have known not to bring in any of the lines with the exceptions?  They don't match the pattern, yet it keeps pulling in the FARMLAND lines as additional multi-lines in the fields.  This is the zone on one of the document pages:

     Thx, Connie Prendergast, Flagstaff County

 

0 0

Replies

replied on June 11, 2015 Show version history

You could use the following pattern on a multi-line token: ^(?!FARM).+$

^ marks the beginning of line and $ marks the end of line

.+ would match 1 to many characters

(?!FARM) is a lookahead which would match further only if the line doesn't start with FARM

Then you can use the token values like this:

%(Token 1#[1]#)
%(Token 1#[2]#)
%(Token 1#[3]#)
%(Token 1#[4]#)
%(Token 1#[5]#)

which should return the following based on your sample image above:

NE-10-045-14-4
NW-10-045-14-4
SW-10-045-14-4
NW-11-045-14-4
NE-17-045-14-4

0 0
replied on June 12, 2015

Thanks, Eric.  Tried a few versions of this but it didn't work for me.  I think for two reasons.  1) I will never know how many lines there will be so I can't set a number of instances of the tokens; 2) I don't get the same screen you get for Edit Token and it might be because I don't have one of the add-ons.  I can edit the token, but I get this:

As you can see I've set the Apply Regular Expression back to the format I want it to allow, but it is still picking up the FARM lines even though when I try a test value for FARM in this Edit Token window, it ignores those attempts.

Does your code of ^(?!FARM).+$ tell it to ignore those lines?  I'd sure like to be able to use something like that.

0 0
replied on June 18, 2015

My VAR has helped me with this and here's what worked:

He had me remove all the formatting within the Zone OCR Advanced Options (other than Multi Value).  We then set the Regular Expression using the Token Editor on the token that was placed in the actual Field.  This expression will only return the lines that match this letter/number combination (which QF didn't seem to respect when I had it set it in the Advanced Options).  Not sure why it made a difference where we set the token format, but it did!

      

It works!  In fact, my VAR showed me how I could use this token in two separate fields, and have QF separate out the two different types of legal addresses into the right fields (We have one field formatted for the legal/long address and another field formatted for when the address in the form of Plan/Block/Lot.

Awesome!

Connie Prendergast, Flagstaff County

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.