[ < < < Home ] [ < < Reference Start ] [ < Reference Contents ]
[ < Previous=PDGREPPE Literal File ] [ Next=PDGREPPE Separation > ]

Intelligence Services

PDGREPPE Controls

Controls provide

	MATCH CUTS

and

	UPPER/lower Case Sensitivity

in a pattern.

MATCH CUT CONTROLS:

These cut like a pair of scissors after a successful search.

One side of the scissors is given by ":a" and the other
side of is given by ":b".

They can be used to cut from AFTER ":a" a point to BEFORE ":b"
another point.

They cut-out a section of a search match that is then recognised
as the result of the search.

 :a	cut match After  this point

This is used to cut from LEFT TO RIGHT from where it is found,
and the nearest match End or ":b" Cut Before mark.


	pdgreppe -Hjc "Text:aTools" file_id.diz


..."Text:aTools" finds area "TextTools" in file_id.diz and cuts
":a" After "Text" from left to right so that only "Tools" is
selected as the match.

 :b	cut match Before this point

This is used to cut from RIGHT TO LEFT from where it is found,
and the nearest match Start or ":a" Cut After mark.


	pdgreppe -Hjc "Text:bTools" file_id.diz


..."Text:bTools" finds area "TextTools" in file_id.diz and cuts
":b" Before "Tools" from right to left so that only "Text" is
selected as the match.

Caveats:

Before/After cuts ":[ba]" in REPEAT tests and OR/AND
sequences take the value of those in the most successful match.

In an Or/And sequence, before/after ":[ba]" controls take the
values of the most successful (widest OR "|" or thinnest OR "~"
or rightmost AND "&") match.

Before/After Cut Controls and Matched Terms of EQUAL Width:

If two terms were given for a match of "123|1:a2:b3" and the
match were made, then the match width would be ONE "2" for the
term "1:b2:a3" because it is the RIGHT-MOST match.

If two terms were given for a match of "1:a2:b3|123" and the
match were made, then the match width would be THREE "123" for
the term "123" because it is the RIGHT-MOST match.

The search Window-Width, given by option "-w<d>", has higher
priority in determining a match width that may be later adjusted
by the Cut Before and After controls.

For example a pattern of

	xyz:b.+

with a Window Width of 3

	-w3

will find any "xyz" in data, and if there is other data beyond
"xyz", the match Width will be greater than 3 and have exceeded
the limit.  Therefore the test will fail, without regard for the
Before-Cut ":b".

Case Sensitivity Controls:

These are determined when the pattern is made but mostly take
effect at time of search.

Case Sensitivity means the comparison between upper and lower
case letters like "ABC" and "abc".  If case SENSITIVE then they
are NOT the same.  If case insensitive they are seen as the
same.

If NOT option -i:

 :i	case sensitivity Ignored

This enables upper and lower case letter characters to be seen
as equivalent to each other, e.g. "A" == "a".


	pdgreppe -Hjc ":iea" file_id.diz


...":iea" finds any ":i" upper or lower case string "ea" in
file_id.diz.

Option -i cancels any effect by Case Control :i in pattern.

 :c	Case sensitivity enabled

This enables exact matching for upper and lower case letter
characters "on-the-fly".  Used with control ":i".


	pdgreppe -Hjc ":itt" file_id.diz


...":itt" finds any ":i" upper or lower case "t" followed by
another similar "t".  The patterns ":iTT", ":itT" or ":iTt"
would find the same.


	pdgreppe -Hjc ":it:cT" file_id.diz


...":it:cT" finds any ":i" upper or lower case "t" followed by
upper case "T" in file_id.diz.

Case Controls :[ic] at the end of a

	OR/AND "|~&" sequence

or

	ANY REPEAT test

are the SAME as before the sequence or test.

Option -i cancels any effect by Case Controls :c in pattern.

Case Controls and (MarkedGroup), % or # References:

The repeated data match operator "%" DOES NOT imply exact the
same case sensitivity for upper and lower case letters that was
in effect when a previous Marked (Group) did its test:

A previous (Marked Group) might have passed any of both upper or lower
case letters in a Case Insensitive match area by use of the Case
Insensitive Control ":i" before or at the start of the (Marked Group).

If the pattern section that contains the "%" operator has the
Case Sensitive Control ":c" in effect, the ":c" negates the
Insensitive Case Control ":i", so the match only succeeds if the
match areas are exactly equal to each other.


	pdgreppe -Hjc "(E).*%0" file_id.diz


...Marked Group Re-Match "%" operator in "(E).*%0" finds capital
letter "E" followed by zero or more ANY other characters ".*"
followed by the last occurrence of an identical CAPITAL letter
"E" by use of "%0".


	pdgreppe -Hjc ":i(E).*:c%0" file_id.diz


...Marked Group Re-Match "%" operator in ":i(E).*%0" finds UPPER
or lower letter "E" (":i") followed by zero or more ANY other
characters ".*" followed by the last occurrence of an IDENTICAL
UPPER or lower letter "E" by use of ":c%0".  (":c" denotes Case
sensitive).

The opposite situation can also occur:


	pdgreppe -Hjc "(E).*:i%0" file_id.diz


...Marked Group Re-Match "%" operator in "(E).*:i%0" finds
capital letter "E" followed by zero or more ANY other characters
".*" followed by the last occurrence of an UPPER or lower letter
("E" or "e") by use of ":i%0".  (":i" denotes case Insensitive).


	pdgreppe -Hjc "(E){%0!.}*%0" file_id.diz


	pdgreppe -Hjc ":i(E){%0!.}*:c%0" file_id.diz


	pdgreppe -Hjc "(E){%0!.}*:i%0" file_id.diz


...these work like the previous examples but find the Marked
Group (E) followed by zero or more NOT the same as the Marked
Group Data "{%0!.}*", then the FIRST occurrence of the Marked
Group Data, with examples for ":c" and ":i" case operators
repeated.

A pattern or sub-pattern that only consists of one or more
controls from

	:[abci]

is  an empty pattern and matches EVERY data point for zero
width.

[ < < < Home ] [ < < Reference Start ] [ < Reference Contents ]
[ < Previous=PDGREPPE Literal File ] [ Next=PDGREPPE Separation > ]

Intelligence Services

© Intelligence Services 1987 - 2008   GPO Box 9,   ADELAIDE SA 5001,   AUSTRALIA
EMAIL   :   intlsvs@gmail.com