Make your own free website on Tripod.com

[ < < < Home ] [ < < Reference Start ] [ < Reference Contents ]
[ < Previous=PDGREPPE 3.13 Introduction ] [ Next=PDGREPPE Expression Parts > ]

Intelligence Services

PDGREPPE Magic Patterns

Why have Magic?

Magic is useful and powerful.  It can detect or change data in
many versatile and variable ways.

Sometimes a search pattern must find data THAT CAN VARY and do
so in a single pass.  It can then display or otherwise present
all the data match varieties.

Also Magic variable modifications can be made to pieces of data
that themselves vary.  These changes are dependent on the way
each datum varies.

The alternative to Magic is that each fixed search datum of a
complex set must be searched for and/or changed individually.
This is alright for a very limited set of data but very time
inefficient for larger sets of data.

Some disadvantages to Magic can be:

(1) Time is needed to learn and adapt to Magic.

(2) If rules to Magic are disobeyed there are penalties.

(3) Special symbols to Magic also have non-Magic significance.

(4) Magic can change from one version or type to another.

PDGREPPE addresses these by having these corresponding
features:

(1) This file and on-line program info are available.

(2) Feedback is given when mis-formulating a Magic pattern.

(3) Options exist for making Magic symbols less accessible.

(4) Magic in PDGREPPE is similar to existing Magic varieties.

Finally - Magic can be fun!

It can do plenty interesting things in very useful ways.

That's why Magic exists!

Magic Pattern Development

Creation of Magic Expressions is almost always done by

	Trial and Error

so PDGREPPE has been specially adapted to allow for greater
access to Error information.

Correction facilities consist of

	Error or Warning messages

that show parts of a pattern not suitable or workable

Also there are

	Debug Options

that give further details on misses, unintended search hits or
erroneous replace changes/deletions.

For Example PDGREPPE has a special search option

	-jL	  show Last match details if not found.

that shows what part(s) of a pattern Last matched any data so
further refinement and correction of patterns can happen easily
by comparing the any or last matches in the pattern with what
was intended for a search.

A Summary option

	-s show Summary of Pattern, File and Results per file.

shows any pattern Expansion to the "Full Pattern" from an
initial pattern.

Magic Expression (ME) Pattern Symbols:

MAGIC Symbols for PDGREPPE are ALL Punctuation Characters of
a standard American-English or Australian-English character set
found on IBM-PC's and most computer terminals.

Magic Expressions(ME's):

A ME is part or all of your Pattern for searching for data.

It is either a small part like a single or multiple character
expression, or a group enclosed within { and } or ( and ).

Those with special meaning to Search Patterns are any of

	^$[].(){}<>#%-/;!?*+&|~`'@:,= and \

(these are described in the first part of this section)

and NOT

	double-quote (") or under-score (_).

The "_" UnderScore symbol is used as a part of variable names in
most computer languages.

The " Double Quote is used to give exact literal strings
in most computer programs and operating systems.

Those with special meaning to Edit Patterns are any of

	+,-:%\{}

(These are described in the last part of this section.)

PDGREPPE Magic Expressions can have:

	Logic Operators (OR and AND)		( | ~ & )

	Grouping Sequences and References	( (G) {G} # % )

	Quantity or Repeat operators		( -/;!?*+ )

	Position locators			( `^<>$' )

	Single Byte Character symbols		( \<c> [x] . )

	Double Byte Character symbols		( \N \0[BDHOX] )

	File Inclusion				( :f[file] )

	Controls for cutting and case control	( :[abic] )

	Definitions for pattern storage/re-use	( @Def @@Macro )

	Edit functions for changing data

These are sometimes used and referenced before the other
sections where they are more fully explained.

[ < < < Home ] [ < < Reference Start ] [ < Reference Contents ]
[ < Previous=PDGREPPE 3.13 Introduction ] [ Next=PDGREPPE Expression Parts > ]

Intelligence Services

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