Return to AboveSoft Analyzer Manual

Pattern Matching

Pattern matching is used whenever you Search for Programs using the "pattern matching" feature, when you execute a Broken Naming Conventions / Broken Rules detection or when analyzing Productivity. Pattern matching is case-insensitive.

When searching for Programs containing words or a pattern; the matching is performed on a line-by-line basis. When executing a Broken Naming Conventions / Broken Rules detection or analyzing Productivity, the matching is performed on an instruction-by-instruction basis (which also eliminates colons to separate instructions and reduces several spaces between characters to one space). Thus, Search for Programs is not suitable for extensive pattern analyses on instructions; since it will fail to match patterns on instructions which are built on multiple lines (e.g. SELECT clause). For that purpose create a new set of Rules (click on "Hardcode, Broken Naming Conventions and Broken Rules" button; then double click on any Broken Naming Conventions file).

When searching for programs using the "pattern matching" feature; the application automatically adds an asterisk at the beginning and at the end of the pattern to include all the matches at the middle of a line.

Characters in pattern:

? Any single character
* Zero or more characters
# Any single digit (0-9)
[charlist] Any single character in charlist
[!charlist] Any single character not in charlist

NOTE: To match the special characters left bracket ([), question mark (?), number sign (#), and asterisk (*), enclose them in brackets. The right bracket (]) can't be used within a group to match itself, but it can be used outside a group as an individual character.

Pattern composition:

A* Matches anything starting with an A (or starting with an "a" since pattern matching is case-insensitive).
A? Matches two characters, the first one being an A
A# Matches two characters, the first one being an A; the second one being any number
A[5-9] Matches two characters, the first one being an A; * the second one being a number from 5 to 9
A[A-F] Matches two characters, the first one being an A; * the second one being a letter from A to F
A[!G-Z] Matches two characters, the first one being an A; * the second one being any letter except those from G to Z
A[ABCD] Matches two characters, the first one being an A; * the second one being the letter A, B, C or D

Examples:

Pattern Matches
SELECT * FROM * BKPF * Matches any SELECT clause that access table BKPF (even in a JOIN). Note that the first asterisk matches any field list (not only clauses which are using the asterisk)
SELECT [*] FROM * BKPF * Matches any SELECT clause that access table BKPF (even in a JOIN) and uses the asterisk to retrieve fields.
*FROM T00[1-3]* Matches for example SELECT ... FROM T001; SELECT ... FROM T002; SELECT ... FROM T003