DETECT

Top  Previous  Next

Syntax

 

 detect column(s),row(s),"[^[!]]text"

 detect column(s),row(s),"[^[!]]~regexpr"

 

Description

 

This option is used to identify a form from the data read by UnForm.  If the -r option is used on the UnForm command line, then detect keywords are ignored.  Otherwise, each rule set's detects are analyzed until a match is found.  If more than one detect keyword is specified for a rule set, then the job must match all of them.  Detection occurs only at the start of the job, using the first page of data read from the input stream.

 

If column and row are 0, then the whole page is scanned for the occurrence of the text.  If column is 0 and row is greater than 0, then the whole line is scanned.  If column is greater than 0 and row is 0, all rows are scanned.

 

column and row can contain ranges in the format from-through, such as '20-25' for the columns (or rows) 20 through 25.  Column ranges must include the entire number of columns to search, so to detect the word "Invoice", the second number must be at least the rightmost possible position of the "e".

 

The format of the quoted third parameter determines how the detection scan is handled.  If plain text is specified, then a literal match for text is performed.  If the text begins with the prefix character ~, then a regular expression search for regexpr is performed.  

 

If the text begins with ^, then a case insensitive match is performed.

 

Following the optional ^ character, but before the ~ character, may be a ! character, indicating a scan for NON-matches.

 

The following prefix sequences are valid: ^, ^~, !, !~, ^!, ^!~, meaning, respectively: case insensitive text, case insensitive regular expression, text not found, regular expression not found, case insensitive text not found, case insensitive regular expression not found.

 

DTC Rule Sets

 

When the UnForm Desktop Client processes detect statements, it honors certain options.  For details, see the Desktop Client rule set section.

 

Web Extension Rule Sets

 

When the SDSI Web Extension processes detect statements, it honors certain options.  For details, see the Web Extension rule files section.

 

Examples:

 

detect 0,2,"INVOICE" would search for INVOICE anywhere on line 2.

 

detect 10-22,4,"~../../.." would match a date format between columns 10 and 22, on row 4.

 

detect 65-76,6-8,"!~../../.." would match a date format NOT occurring between columns 65 and 76, on rows 6 through 8.

 

detect 0,2-3,"^invoice" would match INVOICE, Invoice, invoice, etc. anywhere on lines 2 or 3.

Drivers: all