[ < < < Home ] [ < < Reference Start ] [ < Reference Contents ]
[ < Previous=PDL - Pattern Definition Language ] [ Next=FGREPPE 3.13 > ]

Intelligence Services

PDGREPPE Options

PDGREPPE has option Menu sections for:

File, View, Search, Replace, Definitions, Debug, Misc and Help.

The File Menu gives standard options shared by other Text
Tools as well as two very special ones, -F<d> and -D<d>, for
using Magic Patterns to select directory or file paths of the
files to be searched.

View options are mostly detailed in the sections on COMMON and
GREPPES Options.

Search and Replace Menu options are detailed in GREPPES Options
but also include special options affecting pattern compilation
and matching that are discussed in this section.

The Definitions Menu has ALL options that regulate use and reuse
of magic patterns stored in simple text files as definitions.
These are some of the most potentially useful options for power
users of PDGREPPE and Magic Pattern matching.

Options "-jL" or "-T" can help a user to see what part of a
magic pattern passed or passed Last, so an incomplete or faulty
pattern can be corrected.

Or if a user wants to compare the extremely FAST FILTER pattern
matching mechanism in PDGREPPE to a normal and underlying SLOW
but PRECISE matching standard mechanism, option "-jo" exists
under the Debug menu.

As well, a standard HELP menu gives options on options as shown
in COMMON Options.

For BEGINNERS the most useful options are listed in the
Greppes Options section.

Some very useful options particular to PDGREPPE are:

	-w<d>	  unlimited repetitions head room Width in bytes. (1024)
	-x	  repeat patterns <pat>[+*?-/;] can X (cross) at newline.
	-E	  Exclude Search Magic "^$[].(){}<>#%-/;!?*+&|~`'@:,=" unless '\'.
	-L	  all in pattern are Literal search.
	-W	  White Space for clarity in pattern.
	-jh	  set <d> of -w<d> to Half of maximum width.
	-jL	  show Last match details.

as detailed below.

Please see the section on "Option Notes" at the end of this
section for important information about GLOBAL effects of
certain options.

************
Descriptions of Individual Options : START

COMMON OPTIONS:
-$	  show contact information.
-?	  show program information.
-C:f<d>	  string for File insert for -C options. ([F])
-C:i	  when option -C<d> Ignore ERROR LEVEL.
-C:n	  when option -C<d> No filter.
-C<d>	  pre-filter input data by Command <d> with sub [F].
-N	  No process of data.
-O	  turn Off all options.
-R<d>	  Register this program with supplied key <d> and .KEY file.
-a	  show All of Many options by Menu.
-h	  select Hidden files too.
-ja	  just examine All-ASCII files.
-je	  expand Environment %VARIABLES% in program parameters.
-jf	  Filter output to Text characters.
-jn	  wait for Network access.
-jp	  do data Prompt.
-jq<d>    command quote sequence. (")
-jt	  just examine all Text files.
-kB	  show edit Backup:<InputFile>-><BackUpFile> when -ke -ko and -kb.
-kF	  edit Files as NOT having DOS 8.3 file names.
-o	  Omit single file name at start of output.
-tA	  append All output if option -to<d>.
-tC	  open all files as Compatible for sharing.
-tF<d>	  default directories for option -jF<d> command File(s).++ (.;:HOME:)
-tI	  show all options by Input/Output.
-tK	  allow Key buffer for typeahead.
-tO	  append Output if option -to<d>.
-tS	  show all options by Sequence.
-tT<d>    Temporary files directory. (%TEMP%)
-tV<d>	  display message <d> on Video screen.
-tW	  append Warnings and error messages if option -tw<d>.
-ta<d>	  save All output to file <d>.
-tb	  disable VGA Blink.
-tc<d>	  column to wrap data display.
-td	  show screen space or tab as Dot or diamond.
-te	  Eliminate screen status line.
-tf	  try old standard DOS 8.3 File names first.
-ti	  use Input by pipe | or redirect < for Keys Input.
-tk	  press Key to continue.
-to<d>	  save Output to file <d>.
-tw<d>	  save Warnings and error messages to file <d>.
-tx	  use eXplicit *: and / in file paths.

See Common Options.

OPTION:

-1	  process only 1 match per line.


See Greppes Options.

OPTION:

-@<d>	  file(s) for Search pattern @Definitions.++ (ere.def)


In the file(s) given by string <d>, list(s) of Search pattern
definitions can be stored.  When files are specified by this
option they become a source of pattern definitions used by
PDGREPPE like "@myDef" in its Search patterns.

Like other options that specify data items, only the last use of
option -@<d> has its data <d> list used.  Other possible
previous use of -@<d> is ignored.

The file list items can be separated by commas (,) or semicolons
(;).

The first or left-most files in the list <d> are the first ones
searched for definitions.  Warnings are given for any possible
duplicate definitions in following file(s).

Each file name must be exact like "MYFILE.DEF" for a file in the
current directory or "..\XFILES.DEF" for a file in the next
higher directory.

The files in the list <d> do not need a ".DEF" extension but if
there is an extension then it must be part of the listed name.

A default definition file (DDF) is used WITHOUT this option.

It has a base name of "ere" with an extension of "def" to become
"ere.def".

It is first searched for in the current directory.

If not found there, and option -j@<d> is used,
then it is searched for in the directory <d>,
or in the case of multiple directories as <d>,
in each directory, from left to right, in <d>.

See PDL Info for more on "@" pattern definitions.


	pdgreppe -1 -Hjc "<\W+>" file_id.diz


..."<\W+>": search for words.


	pdgreppe -1 -Hjc "@Word" file_id.diz


..."@Word": search for words based on definition "@Word"
in file "ere.def".


	pdgreppe  -Hjc -@file_id.diz "@PDGREPPE" file_id.diz


..."-@file_id.diz" uses FILE_ID.DIZ definition for "@PDGREPPE"
in file_id.diz (@PDGREPPE would mean the string "Search Edit by
MAGIC patterns,").

OPTION:

-A<d>	  show up to <d> lines After match line.


See Greppes Options.

OPTION:

-B	  Blink in match to screen.


See Greppes Options.

OPTION:

-D<d>	  use ERE pattern <d> to select Directory names. (.+)


When selecting files, the entire directory portion of
the full path name must match this pattern for the
search to take place.

For example to enable selection of all directories beginning
with the prefix "win" or "dos" set this option something like

-D"{<win|<dos}.*".

If a drive specification is given in basic full path, pattern
<d> must include this too like

-D"c:\\{<win|<dos}.*"

Do not put a DS '\' at the end of a pattern.

(Any directory separator '\' at the end of a directory name
is removed by a Text Tool before trying to match to pattern.)

The pattern is affected by most options for ERE patterns
and is case insensitive.

OPTION:

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


To make the use of ALL magic characters LESS accessible.

This makes ALL "magic" characters be NOT magic (unless escaped
with backslash '\' in the pattern).

Good for when a pattern contains many of the special characters,
that are also used by the Magic Matcher, to make the special
characters represent just themselves as LITERAL characters.  See
also option "-L" and pattern magic ":f<file>" control.

THIS HAS GLOBAL EFFECTS : IT WILL AFFECT USE OF PATTERNS IN
DEFINITION FILES and patterns for options -D<d>, -F<d>.


	pdgreppe -Hjc ".|(|)|<|>" file_id.diz


...without regard for Magic effects in

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

the pattern maker in PDGREPPE spits out error messages since
Magic characters have Magic rules.


	pdgreppe -Hjc -E ".\|(\|)\|<\|>" file_id.diz


..."-E" and same will shield any of ".()<>" from magic effects
and let OR operator "|" be magic by becoming "\|"
escape-then-OR.

See also options -jX<d> and -kX<d>.

OPTION:

-F<d>	  use ERE pattern <d> to select File names. (.+)


Like -D<d>.

When selecting files to examine, the file portion of the
file full path must match this ERE pattern for the search of
the file to happen.

For example to enable selection of all files ending with the
extension "doc" or "bak" set this option with -F".*\.{doc|bak}".

The pattern is affected by most options for ERE patterns
and is case insensitive.

OPTION:

-G	  show data in match area Gap only.


See Greppes Options.

OPTION:

-H	  High intensity in match to screen.


See Greppes Options.

OPTION:

-I	  show pattern Information.


See Greppes Options.

OPTION:

-L	  all in pattern are Literal search.


Any pattern given contains NO magic characters.  NO
interpretation is made of the pattern characters, they are
searched for exactly what they are.

Pattern Definitions and other magic symbols/sequences will NOT
be recognised in a pattern.


	pdgreppe -1 -Hjc "." file_id.diz


..."." match-ANY-character has Magic Effects, including spaces.


	pdgreppe -Hjc -L "." file_id.diz


..."-L" means match-ANY-character has NO Magic Effects.

To have literal sequences mixed with magic patterns, try -E as
an option or control sequences ":f<file>" as a part of a
pattern.

To use just "-" as a -L LITERAL PATTERN:

	put a space between -e and -


	pdgreppe -Hjc -L -e - file_id.diz


or

	put double quotes around the -


	pdgreppe -Hjc -L -e"-" file_id.diz


OPTION:

-P<d>	  show up to <d> lines Previous to match line.


See Greppes Options.

OPTION:

-Q	  Quit program on first match.


See Greppes Options.

OPTION:

-S	  show Summary for group of files.


See Greppes Options.

OPTION:

-V        strict program return Value.


See Greppes Options.

OPTION:

-T	  Trace details of Search.


This is the same as option -jL.  It allows a ERE pattern
to reveal its pass/fail locations for a series of passes
over an entire file search.

See Last Match Trace options -jL (same as -T) and -jG.

OPTION:

-W	  White Space for clarity in pattern.


When using a potential magic pattern (NOT all-are-Literal-search
option -L), any White Space (space or tab characters) can be
placed in the pattern to make the pattern more readable.  Only
White Space characters escaped by the backslash "\" like Return,
LineFeed, Space and Tab will be included as part of the pattern.

This is similar to option -E that escapes special characters.

THIS HAS GLOBAL EFFECTS : IT WILL AFFECT USE OF PATTERNS IN
DEFINITION FILES and options -D<d>, -F<d>, -jh<d> and -jv<d>.


	pdgreppe -HjcE ".\|(\|)\|<\|>" file_id.diz


...without white space.


	pdgreppe -HjcE -W ".  \|  (  \|  )  \|  <  \|  >" file_id.diz


..."-W" means pattern can have extra White space.

See also options -D<d>, -F<d>, -jh<d> and -jv<d>.

OPTION:

-X<d>	  eXclude files list.++


Similar to -F<d> but for eXcluding files.

Option -F<d> gives greater exact specification for
including or excluding Files.

See Common Options.

OPTION:

-b	  show file match Byte position with prefix FP.


See Greppes Options.

OPTION:

-d	  show output Data length with prefix DL.


See Greppes Options.

OPTION:

-e<d>	  Exchange for different search pattern <d>.


This is the same as for FGREPPE.

A mistake can occur when a SINGLE MINUS SIGN is used as the
literal search pattern after options -L (all characters in
pattern are Literal) with option -e:

the MINUS SIGN is interpreted as meaning "turn off" option -e
and any current pattern.

BEWARE

When a SINGLE MINUS MARK is used as the search pattern with
option -e like:

	-e-

It is interpreted as "turn off" option -e.

Use

	-e"-"

instead.

See the Options Section for PDGREPPE about Option -e<d>.

See Option -L for details.

See Greppes Options.

OPTION:

-f	  show File name at front of each line.


See Greppes Options.

OPTION:

-g	  show match Gap length with prefix ML.


See Greppes Options.

OPTION:

-i	  letters in pattern are case Insensitive.


This has GLOBAL effects : it will affect use of patterns in
definition files.

See Greppes Options.

OPTION:

-j@<d>	  @Definition file(s) default directories.++ (.;:HOME:)


When PDGREPPE looks for a pattern definition file and one is not
available as given,  then PDGREPPE will prepend any of the
directory values in <d> to the file name BEFORE trying to open a
definition file.  More than one value in <d> must be separated
by "," or ";" and the list <d> is processed from left to right.

Use of <d> only occurs if the current file is NOT an absolute
path (NOT starting with "\" or <drive>:).

If this option is given in a startup default ENVIRONMENT
variable like PDGREPPE_OPTIONS, then this can become a general
way of ALWAYS having a default directory ready for PDGREPPE to
use for locating Definition Files.

When this option is used along with option -jD, the expanded
Full pattern for @definitions show the actual paths to the
definition files.

Note:

The default string ".;:HOME:" as <d> will try to find the
file(s) first in the current directory ".", and if not found
there, will try the ":HOME:" directory for the program,

e.g. c:\bin for c:\bin\NLX

to find the file(s).

The default string ":HOME:" as part of -j@<d>,
conveniently includes the home directory of
a Text Tool as one of the directories.

See also Option -@<d> in this section.

OPTION:

-jA       options with Attached list data (++) can Accumulate.


This works for PDGREPPE options like -@<d> definition file list.

See Common Options

OPTION:

-jD	  show Search @Definition=File:LineNumber={Pattern} in FullPattern.


Show what the Definition origins and patterns are when using
summary option -s.


	pdgreppe -1 -Hjc "@ConsonantNotUpper+" -jD -s file_id.diz


will show part of UserPattern

	"@ConsonantNotUpper+"

where Definition "@ConsonantNotUpper" is found

1) file ERE.DEF

2) the line number in file ERE.DEF where the definition is found

and

3) the Pattern in File ERE.DEF as "[\C^\u]"

when a summary (option -s) is given for each file searched by
PDGREPPE.

OPTION:

-jE<d>	  <d> is string to show match End. (>)


See Greppes Options.

OPTION:

-jF<d>	  take options and specs from File name <d>.


The best way to get long lines of pattern data into PDGREPPE is
to use PDL (Pattern Definition Language) files.

With PDL files more indentation and continuation options are
available than with this simple option.  (See PDGREPPE Info).

See Common Options.
See Greppes Options.

OPTION:

-jG	  fine Grain for Trace details when using option -T.


Normally options -T or -jL will only give a Pass Mark "$"
at the last character of a literal string that matches:

abc
01$

With option -jG this is expanded to be Pass Marks for each
and every character where the string matches, e.g.

abc
$$$

for a full pass of segment "abc"

or

abc
$$2

for a partial pass of segment "abc" up to the letter "c".

See options -jL and -T.

OPTION:

-jL	  show Last match details.


This is USEFUL for showing where a search pattern passes.

When searching with a magic pattern, and especially complex
patterns, this option gives information or "tracing" to show how
or where a pattern has passed or failed.

PDGREPPE usually does two searches, a "fuzzy" search to quickly
locate necessary fragments of the pattern and then, if the fuzzy
search succeeds, or is not given (option -jo), an "exact" search
is done to compare data byte-by-byte and position-after-position
with the pattern.

A pattern can pass or fail in either of the two searches.

For each file this option will try to:

1.

Indicate if the all or part of the pattern passed.

2.

Output the FULL PATTERN up to the point where the last pass was
recorded.

(A full pattern can be more than the basic user pattern if it
includes pattern definitions or references to previous parts
of the pattern or file names.)

3.

Display the matches in a pattern by showing where various
pattern segments passed.

Literal elements (e.g. abc),
matches to (Marked Group) data "%",
any byte ".",
[sets],
<word>,
<<variable>>,
StartOfFile SOF (`),
EndOfFile EOF ('),
StartOfLine SOL(^)
and
EndOfLine EOL($)

positions are marked in reverse video on the screen and also in
a numbered position string by giving them a dollar sign ($) at
the points where they passed.

Examples:


	pdgreppe -jL "Z" abc


File "abc" just contains "abc" so a simple failure message is given.


	pdgreppe -jL "a.*Z" abc


A more detailed failure message is given.  In this case the
"fuzzy" search failed and so the "exact" search was skipped.

The letter "Z" was never found so it is not marked.

The full pattern is the same as the user pattern of "a.*Z".

Under the "a" is a "$" sign to show it passed.


	pdgreppe -jL "{Q|a}c" abc


Like the previous example, the parts of the pattern show that
some part of the "fuzzy" search passed, to include both "a" and
"c", but alignment failed since "a" and "c" are not directly
next to each other as specified in "{Q|a}c".

The pattern elements of "a" and "c" are marked as passes in the
failure details by giving them in reverse video to the screen
and also by "$" and "?" marks in the numbered position string.

The letter "Q" was never found so it is not marked.

Notes:

An failure occurs when something is just not found past one or
more items that were found.

The EXACT or FUZZY search Last Match patterns will correspond to
the FURTHEST match to data that occurred for one or more pattern
matching attempts in a single file.

Literal Sequences:

Only the last mark for a literal file sequence like

	:f[xyz]

that matches will have a passed match string like

	012345$

If a literal string in a pattern like

	abc

completely passes then a match string like

	01$

is given for pass to show that the last pass occurred
at the last character in the string.  (This can be made
more exact with option -jG.)

THERE IS A PERFORMANCE PENALTY TO USING THIS OPTION.

Large patterns or patterns that include many or long literal
strings may be unable to be built since:

There is a limit of 256 literal sequences to the compiler.

The last pass recording space may take up too much memory.

See Trace options -T (same as -jL) and -jG.

OPTION:

-jN<d>	  Search (% or #) and Replace (%+-?) (Marked Group) Number Start. (0)


This option is for using SEARCH or REPLACE pattern reference
operators like "#" and "%" with a non-zero number.  Some people
feel more comfortable using the number ONE rather than the
default number ZERO (0).

For example the pattern

	(a)d%0

would find the string

	ada

But with the -j1 option the pattern would become

	(a)d%1

to find the same string.

The minimum number for this is the default of ZERO (0).

The maximum number for this is 255.


	pdgreppe -1 -Hjc "(\u)%0" file_id.diz


...marked group Re-Match "%" operator in "(\u)%0" finds capital
letter "(\u)" followed by identical capital letter "%0".


	pdgreppe -1 -Hjc -jN1 "(\u)%1" file_id.diz


...like the preceding example for the marked group Re-Match "%"
operator but this time with Marked Groups referenced to start at
*** 1 *** with "-jN1", and again "(\u)%1" finds capital letter
"(\u)" followed by identical capital letter "%1".

OPTION:

-jO	  Optimise for repeated pattern @definitions.


The default is to search ALL definition files (PDFILE's) for
each pattern definition EACH TIME a definition is encountered in
a pattern.

This can be VERY SLOW if the pattern has many repeated
definitions, and especially if definitions are kept at the end
of a large PDFILE or in the last PDFILES given by options
"-@<d>" or "-k@<d>" .

With option "-jO", a cache of definitions' information
is stored in memory and in temporary files by PDGREPPE
so further retrievals can be done from these.

This option builds patterns much more quickly when a pattern
uses or reuses many definitions.

However, this option does tax the memory and disk space
available so it may impinge on other resources.  This effect can
be minimised by reducing the number of definitions in files if
memory resources diminish.

Also, use of this option with option

	"-jW" for definitions Warnings

causes definitions in ALL PDFILE's to be checked for bad names,
repeats or empty values, not just the ones in the current
pattern.  These warnings continue until the current pattern is
completed.

This option affects both Search and Replace patterns.

See PDGREPPE Option "-jW".

OPTION:

-jR	  Rescan data continuously.


See Greppes Options.

OPTION:

-jS<d>	  <d> is string to show match Start. (<)


See Greppes Options.

OPTION:

-jT<d>	  Text characters range is <d>. ([\9\10\13\32-\126])


This range can only have simple values, NOT the same as a MAGIC
[Range].  It is used to select files that are ONLY text.

See Common Options.

OPTION:

-jW	  show Warnings for pattern @definitions.


When using this option and pattern definitions, if PDGREPPE
finds more than one definition of the SAME name in any of the
pattern definition files, PDGREPPE will report these by file
name and line number.


	pdgreppe -jW "@RepeatedDef" file_id.diz


There is no data to match the pattern "@RepeatedDef" in
file_id.diz but when the pattern compiler makes the pattern it
reports a duplicate definition with the file name and line
number.

It also shows

	Empty PDEF's

that are named properly but have no pattern and

	Misnamed PDEF's

that have non-variable character bytes in their name and

	PDEF's with White Space at the end of a definition

With option "-jO" PDGREPPE will do this for ALL definitions in
ALL files that it encounters, even those that are UNUSED by the
pattern being built.

This option affects both Search and Replace pattern @Definitions.

See Option "-jO".

OPTION:

-jX<d>	  eXclude <d> of "^$[].(){}<>#%-/;!?*+&|~`'@:,=" from Magic like -E.


The attached characters in <d> will have NO Magic (unless
escaped with backslash '\' in the pattern like option -E).

Possible Magic characters in the Search Pattern are any of

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

This option exists to PARTIALLY disable certain user-selectable
Magic characters and allow common use of them in the Search
Pattern.

(The Magic characters can still be used if preceded by the
backslash '\' character.)

THIS HAS GLOBAL EFFECTS : IT WILL AFFECT USE OF PATTERNS IN
DEFINITION FILES, and options -D<d>, -F<d> and -kr<d>.

Example:

To search for characters "-" and "/" in file_id.diz...


	pdgreppe -Hjc "-|/" file_id.diz


...without regard for magic effects in "-|/", the search pattern
maker in PDGREPPE puts out error messages since magic characters
"-" and "/" have Magic rules.


	pdgreppe -Hjc -jX"-/" "-|/" file_id.diz


...-jX"-/" and same will prevent either "-" or "/" from being
Magic and the OR "|" will show them in file_id.diz.

Notes:

Certain magic characters imply other magic characters, so their
corresponding implicated members must also be specified in <d>.

Example:

Paired magic must take into account a matching Start or End symbol

	Start	End
	-----	---
	(	)
	{	}
	[	]

or Dual usage effects

	One	Two
	---	---
	-	[a-z]
	!	[!a-z]
	^	[^a-z]

If Option -E is also being used, the inverse occurs with -jX<d>.
(Magic characters in <d> are the ones ENABLED unless preceded by
backslash '\'.)

See Also Options "-E" and "-kX<d>".

OPTION:

-jc	  show match area in <Closure>.


See Greppes Options.

OPTION:

-jd	  omit Data print.


See Greppes Options.

OPTION:

-jg	  allow Global (Marked Group) Search references (% or #).


This permits main and @Definition patterns to reference ANY
(Marked Groups) contents provided they are uniquely named like

	(Marked Group)=<name>

Here is an example for (Marked Group)=<name> with option -jg:

An uppermost USER pattern on the command line might assign
some name to a marked group

	(abc)=simple

and in a pattern definition file there could be references
to marked group "simple" like

	simpleDef	first 3 letters are %simple

or

	simpleDef	first 3 letters are #simple

by the (% or #) marked group reference operators.

Also option -jg allows the (Marked Group) %<number>, previous
data matching function, to reference (Marked Groups) in
previous matches, before the pattern segment being reused by the
(Marked Group) #<number>, pattern reuse function.

For example, a pattern like

	(([xy])%1)#0

will expand to

	(([xy])%1)#0={(([xy])%1)}

for a total of 4 (Marked Groups) and will match data

	xxyx

but not

	xxyy

because the (Marked Group) data of %1 in the reuse pattern

	#0={(([xy])%1)}

refers to the data "x" of xxyx in the original previous
contained pattern of (Marked Group) 0

	([xy])

of

	(([xy])%1)

Note:

With this option, ALL names for (Marked Groups) are expected to
be UNIQUE and errors are detected if duplicate names are
assigned to (Marked Groups) in any part of the total pattern
to include pattern @definitions.

Also, no (Marked Group)=<name> assignments are allowed in
#<previousMarkedGroup> reuse patterns since these names
are also supposed to be UNIQUE with option -jg.

See Also Option "-kg".

OPTION:

-jh	  set <d> of -w<d> to Half of maximum width.


This sets the approximate search Window width to HALF of the
maximum amount possible for any unlimited repetitions in the
pattern that need head room.

This is good for setting the width to a large amount but also
ensures enough speed that option -jx lacks.

Its size is reported with the option "-ts".  It yields
precedence to option -jx.

See Also Option "-w<d>".

OPTION:

-ji<d>	  directories for literal :f[<file>] Inclusion to patterns.++ (.;:HOME:)


Rather than having to type in complete paths for files to be
literally included in Search and Replace patterns (:f[<file>]),
this option allows these files to be drawn from certain
user-specified directories given as list <d>.

When this option is used, the Standard and expanded Full
patterns show the actual paths for the <file> inclusion.

The first place searched for an ambiguous include pattern <file>
is in the current directory or relative to the current
directory, and if not found, the directories <d> of -ji<d:
are tried in sequence from left to right.

This also affects options -jl<d> and -kl<d>.

Note:

The default string ".;:HOME:" as <d> will try to find the
file(s) first in the current directory ".", and if not found
there, will try the ":HOME:" directory for the program,

e.g. c:\bin for c:\bin\NLX

to find the file(s).

The default string ":HOME:" as part of -ji<d>,
conveniently includes the home directory of
a Text Tool as one of the directories.

See also PDGREPPE options -jl<d> and -kl<d>.

OPTION:

-jl<d>	  use entire contents of file <d> as Literal search data.


This simply lets the search pattern be equivalent to ":f[<d>]"

See Greppes Options.

OPTION:

-jo	  omit fast filter in search.


There are two stages of search that are done to match data.

The first method is a brute strength search to determine if
there is anything "chunky" in the search area that resembles big
bits of items to be found.

This is the "fast filter" search.

The next method is used to determine PRECISELY if the data
region located by the filter search EXACTLY matches the pattern.

Option "-jo" takes the "chunk" detector out of the search
mechanism so that ONLY THE EXACT SEARCH IS DONE by going

	ONE BYTE AT A TIME

through the data region with the

	ENTIRE PATTERN

and checking for a match between the byte and possibly others
exactly after the byte.

If a file does not have any matches then the number of times the
EXACT search method is evoked is the number of bytes in the file
plus one.

This is a VERY SLOW way to search.  The fast filter search
method is used to speed things up.

This option is useful for showing the difference a fast filter
can make in a search and also for doing the most PRECISE
search/match to data that can overcome possible BUGS in the
filter search.

If You are very sure that your pattern should match some data
but does not, then try this option to get a "final" judgement on
whether PDGREPPE should have matched the data.

If You find that just the PRECISE search method with option
"-jo" finds or matches data, it indicates A PROGRAM FAULT and
Intelligence Services would like to know about it.

OPTION:

-jr	  Rescan data until matches detected.


See Greppes Options.

OPTION:

-jv<d>	  Variable name character range is <d>. ([0-9A-Z_a-z])


Variable names are Names in Magic Patterns that are used for
@Definitions or to reference (MarkedGroups) with the #<Name>
and %<Name> symbols.

These are discussed previously in the PDGREPPE Info section and
have the form:

	(MarkedGroups)=VariableName

or

	@VariableName

or

	@@VariableName

or (as used by Start and End of Variable Name matching symbols)

	<<Var

and

	Var>>

This option allows Variable names to contain special non-English
characters or additional/fewer characters in the default range
of [0-9A-Z_a-z].

Variable Names should NOT BEGIN with a number (0-9).

The default set of variable characters ([0-9A-Z_a-z]) includes
the character "_" because it is used as a standard variable
character in most computer languages.

Avoid putting MAGIC characters in this range.

BOTH Variable Names possible for @Definitions and (MarkedGroups)
are affected by this option.

THIS HAS GLOBAL EFFECTS : IT WILL AFFECT USE OF PATTERNS IN
DEFINITION FILES and options -D and -F.

The Range <d> can also be given as a @Definition from a
definition file that ONLY specifies a single [Range].  The
Definition name is expected to be of standard or default
variable form, ie a range starting with a one of

	[A-Z_a-z]

and continuing with any of

	[0-9A-Z_a-z]

ALSO, option -E will affect any special characters "^[]-!@," in
<d>.  The same applies to option -W for white-space.

It affects Variable Names in both Search and Replace Magic
patterns.

See PDGREPPE Info.
See PDL Info.

OPTION:

-jw<d>	  Word character range is [<d>]. ([0-9A-Za-z])


Like -jv<d> just shown, this can be used to adapt Word
characters to similar character set(s), to include non-English
sets that might use non-ASCII bytes with values 128 to 255.

For PDGREPPE, the range <d> has the same form as a MAGIC [Range]
as explained in the Magic Expressions documentation or PDGREPPE
Info section.

THIS HAS GLOBAL EFFECTS : IT WILL AFFECT USE OF PATTERNS IN
DEFINITION FILES and options -D and -F.

ALSO, option -E will affect any special characters "^[]-!@," in
<d>.  The same applies to option -W for white-space.

See Greppes Options.

OPTION:

-jx	  set <d> of -w<d> to maXimum width.


This sets the approximate search Window width to the MAXIMUM
amount possible for any unlimited repetitions in the pattern
that need head room.

This sets the search Window width to the LARGEST AMOUNT
possible.

It allows the search area to be some large value in size, so
that maximum head room is given for finding variable length
items.

It also makes operation very SLOW due to the constant
incremental rescan for any large files.

It takes precedence over option -jh.

The window size is reported with the option "-ts".

See Also Option "-w<d>".

OPTION:

-k@<d>	  file(s) for Replace pattern @Definitions instead of -@<d>.++


This can be used, instead of option -@<d>,
to specify a list of files to make substitution patterns,
which are used in replacement pattern definitions
like "@abc" or "@@mac(P)".

Note:

If option -@<d> is not used, then the default definition
file for option -@<d> is ERE.DEF.

If both options -k@<d> and -@<d> are not used,
the DDF for replace patterns is also ERE.DEF.

Having a separate set of files to build replacement
@Definitions can reduce time taken to build a pattern,
which would otherwise look through all the files
of option -@<d>.

See Also Option "-@<d>"

OPTION:

-kD	  show Replace \@Definition=File:LineNumber={Pattern} in FullPattern.


Like option -jD but for Replace pattern.

See Option -jD.

OPTION:

-kE	  Escape by backslash \ before edit characters %&:+?-{}.


Like option -E but works for Edit Magic characters:

%, &, :, -, +, { and }

OPTION:

-kI	  Ignore case in matches when interactive edit.


As shown in the GREPPES OPTIONS section, this allows
replacements to be made regardless of exact equality between
matches when options -i and -ki are used.

See Option -kI in Greppes Options.

OPTION:

-kL	  all are Literal replace for edit.


When Edit match, no Edit Magic characters like "=&:" are used
for magic in making replacements.  Also, any sequences
like \j and \<n> are inserted exactly as they appear.

OPTION:

-kO	  no diff. in same width & content OR matches when interactive edit.


This is used with interactive edit option -ki.

By default, any matches that have the same literal content and
width, but different associated OR values, are marked as
DIFFERENT for selective replacement purposes, especially when OR
terms differ by zero-width position values such as by `^<>$'
magic position operators.

Option -kO makes those matches seem the SAME so there is no
difference taken into account.

They are then allowed to be used for multiple automatic replace
or ignore RDC's, like [CI-=], without regard for which OR
terms passed.

Example:

A PDGREPPE search pattern such as

"^quack|...|quack$"

could find "^quack" at the front of a line "^"

and also find "quack$" at the end of a line "$"

and would prompt the user to replace these as unique
different entities even if one of them had been
set for automatic replace, delete or ignore.

With option -kO both "quack"s in the OR sequence
would be regarded as the same even though they
occurred and matched at start and end of lines.

See Also Option -kI.

OPTION:

-kR	  Rescan if edit original file, got matches and reduced result size.


See Option -kR in Greppes Options.

OPTION:

-kW	  White Space for clarity in edit pattern.


When using a potential magic pattern (not all-are-Literal-edit
option -kL), any White Space (space or tab characters) can be
placed in the pattern anywhere to make the pattern more
readable.  Only White Space characters escaped by the backslash
"\" like Return, LineFeed, Space and Tab will be included as
part of the pattern.


	pdgreppe "USTRALIA" -kekwkr " :L & " -kW file_id.diz


..."-kW" with edit White space sees user pattern " :L & " as
":L&" and changes entire area found "&" or "USTRALIA" to lower
case via ":L".

See option -W above.

OPTION:

-kX<d>	  eXclude <d> of "{}%+?-&:@," from Magic Replace like option -kE.


The attached characters in <d> will have NO Magic (unless
escaped with backslash '\' in the pattern).

Possible Magic characters in the Edit Pattern are any of

	"{}%+?-&:,".

This option exists to PARTIALLY disable certain user-selectable
Magic Substitution characters and allow unrestricted use of them
in the Edit Pattern.

(The Magic characters can still be used if preceded by the
backslash '\' character.)

Example:

To interactively replace all periods "." by  plus marks "+" in
file_id.diz...


	pdgreppe -Hjc "\." -kekikwkr"+" file_id.diz


...without regard for magic effects in "+", the replacement
pattern maker in PDGREPPE gives error messages since Magic
Replace character "+" has Magic rules.


	pdgreppe -kX"+" -Hjc "\." -kekikwkr"+" file_id.diz


...-kX"+" and same will prevent "+" from being Magic.

If Option -kE is also being used, the inverse occurs with
-kX<d>.  (Magic characters in <d> are the ones ENABLED unless
preceded by backslash '\'.)

See Also Option "-jX<d>", "-E" and "-kE".

OPTION:

-kb	  backup original edit file.


See Greppes Options.

OPTION:

-ke	  Edit matches - Use this to switch ON editing.


See Greppes Options.

OPTION:

-kf	  Force edit changes to file if write protected.


See Greppes Options.

OPTION:

-kg	  allow Global (Marked Group) Replace references (%+-?).


This is like option "-jg" but permits the REPLACE pattern(s) to
reference ANY named (Marked Groups) that are part of the total
SEARCH pattern with replace pattern operators (%+-?) like

	-<name>{<ReplacePat>}

or

	+<name>{<ReplacePat>}

or

	%<name>

See Also Option "-jg".

OPTION:

-ki	  Interactive edit mode.


See Greppes Options (-ki).

RDC's (Replacement Decision Commands) :

The RDC's in PDGREPPE of

C		Change ALL of Same Match in this file
=		Change ALL of Same Match in ALL  files !
I		Ignore ALL of Same Match in this file
-		Ignore ALL of Same Match in ALL  files !

come into special effect when used with Magic Expressions (ME's)
or, like FGREPPE, when searching for a case insensitive pattern
with option -i or a pattern having OR values.

RCS's "C" and "=" match and automatically modify matches of the
SAME Magic Expression that exactly matches the SAME area of
data.

e.g. for case insensitive areas and a pattern of "mind" with data:

mind
Mind
MIND

each one of these lines is a separate match.

e.g. for OR areas:

The pattern "^Front|Front$" will match either "Front" at the
beginning "^" OR (|) end "$" of a line.  Data areas that
contains a match to this can be like:

Front
Front To Back
Back To Front
Front To Front

The sub-pattern "^Front" will match lines 1, 2 and 4.

The sub-pattern "Front$" will match lines 1, 3 and 4.

There are TWO different sets of areas that are matched.

Lines 2 and 3 have data match areas that are DIFFERENT.

Automatic modify commands "=" and "C" will detect any data areas
that are different and only modify those that match in the SAME
way.

RCS's "I" and "-" are similar way but Ignore a particular match.

Option -kO can be used to completely disregard any matches'
differences in OR matches of the same width.

OPTION:

-kl<d>	  use entire contents of file <d> as Literal replace edit data.


This simply lets the replace pattern be equivalent to ":f[<d>]"

See Greppes Options.

OPTION:

-ko	  modify Original file by edit.


See Greppes Options.

OPTION:

-kr<d>	  <d> is edit Replace pattern.


Information about the rule for Edit replace patterns are found
in Pdgreppe Info.

A mistake can occur when a SINGLE MINUS SIGN is used as the
replace pattern: it is interpreted as meaning "turn off" option
-kr and DELETE  will be done for the replacement.

Example:


	pdgreppe -Hjc "\/" -kekikwkr"-" file_id.diz


...the option processor interprets the option -kr"-" replacement
pattern of "-" as TURN OFF any replacement pattern given by
option -kr<d>, and DELETE is done.

To interactively replace slashes "/" by  minus marks "-" in
file_id.diz...


	pdgreppe -Hjc "\/" -kekikwkr"\-" file_id.diz


...the option processor interprets the replacement pattern of
"\-" to mean replace the slashes by minus signs.


	pdgreppe -Hjc "\/" -kL -kekikwkr "-" file_id.diz


Similar with replace option -kL for all replacement to be
Literal, the option processor interprets the command line item "-"
past but separated from -kr as the option data to use.

See Greppes Options.

OPTION:

-kt	  if modify original file (-ko) keep previous Time and date.


See Greppes Options.

OPTION:

-kv	  Verbose edit mode.


See Greppes Options.

OPTION:

-kw	  omit edit Warnings.


See Greppes Options.

OPTION:

-l	  show only one Line with file name if meets criteria.


See Greppes Options.

OPTION:

-m	  show Match number with prefix MN.


See Greppes Options.

OPTION:

-n	  show line Number.


See Greppes Options.

OPTION:

-p	  show line match Position with prefix LP.


See Greppes Options.

OPTION:

-q	  Quit each file on first match.

See Greppes Options.

OPTION:

-r	  Recursive search for file(s), dir\files(s) or dir\.


See Common Options.
See Greppes Options.

OPTION:

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


PDGREPPE can internally change the initial User pattern to a

	Standard Pattern

it can interpret.

Also PDGREPPE can create a

	Full Pattern

that has special significance when @Definitions or #ReUsePattern
symbols are used.

So in this Small (-s) summary if either of these happen and
there is a difference between the original User pattern and
either of the other two pattern types then the different
patterns are shown in the summary.

If the Standard Pattern is identical to the User Pattern
then it is not shown.

If the Final Pattern is the same as the Standard Pattern
then it is not shown.

The Standard Pattern is the one that PDGREPPE can finally
interpret.  It has extra white space removed if option -W is
used.

For example a User pattern like

	x y z

with option -W enabled will have both Standard and Full Patterns
of

	xyz

with white space removed.

(Only the Standard Pattern will be displayed in the summary
since the Full Pattern is the same.)

Or if option -E is used, it has Backslash (\) prepended before
magic characters that are NO longer magic.  If a No Magic
selection is made of certain pattern symbols with option -jX<d>
then this works like option -E for those symbols in the <d>
string of option -jX<d>.

The Full Pattern can have plenty additional information to show exact
expansion contents of any Definitions or Re-Use Patterns in the
form

	<PatternReference>={<ContentsOfReference>}.

For example a User pattern like

	(abc)=Sesame,Here is #Sesame

will have a Full Pattern of

	(abc)=Sesame,Here is #Sesame={abc}.

Or a User pattern like

	@Cmp

that has a definition for Cmp of

	\<\>\=

will have a Full Pattern of

	@Cmp={\<\>\=}

The Full Pattern has even more information for Definitions if
the option -jD is used.  With option -jD the File and Line
number are also shown.  The example just shown might be a Full
Pattern like

	@Cmp=ere.def:123={\<\>\=}

where the file would be "ere.def" and the line number in
the file would be 123, where the definition for @Cmp begins.

Also, if options -ji<d> and -j@<d> are used to define alternate
directories for ERE :f[include] files and @definition files,
then any appearance of file names for these in Standard or Full
patterns will be expanded to show exactly where the files were
located to be used.

See Greppes Options.

OPTION:

-tB	  use minimum length for search Buffer.


See Greppes Options.

OPTION:

-tD	  show screen match/replace space or tab as Dot or diamond.


See Greppes Options.

OPTION:

-ts	  show technical Summary.


See Greppes Options.

OPTION:

-v	  inVert search to lines missing pattern.


See Greppes Options.

OPTION:

-w<d>	  unlimited repetitions head room Width in bytes. (1024)


Use this option to enlarge the total areas for repeat patterns.

This is the "window" size that Repeat operators in patterns like

	".*" or ".+"

use for elastic search.

In these the maximum match length or width has a default maximum
value of 1024 bytes.  (The lower limit is ZERO or 1 byte.)

This option limits the length that repeat operators +,*,/ and -
can match.  So for text files, especially with long lines
greater than 1024 characters long, be sure to increase this
option's value if using +,*,/,- and other Repeat operators or
forms such as *{N,}.

Examples:


	pdgreppe -1 -Hjc "<\W+" file_id.diz


..."<\W+" finds front-ends of WORDS up to the default match
width (1024) plus ONE for the natural byte width of just "<\WW".


	pdgreppe -1 -Hjc -w3 "<\W+" file_id.diz


..."-w3" with same pattern finds WORDS up to maximum match width
of FOUR (4) bytes with THREE bytes for "-w3" plus ONE byte for
the basic match length of just "<W".

Also:

A search window enlarged with -w<d> can increase search time.

The <d> value is the TOTAL repeat length in bytes for ALL
unlimited repeat segments in a search pattern.

If the optional width <d> is excessive, the program will limit
it to the largest possible width.

This option is very useful for increasing the total multi-line
search area length for option -x.

OPTION:

-x	  repeat patterns <pat>[+*?-/;] can X (cross) at newline.


This allows any matches of repeated pattern to test for data
between lines, separated by NewLine sequences.

NORMALLY the Repeat operators in patterns like .* are not
allowed to find any matches in an end-of-line area

THAT WOULD CAUSE THE SEARCH PATTERN TO ADVANCE.

With this option a search for repeated data, starting on one
line, can spill over into the next line(s) and into any traling
NewLine.

This is good for finding a number of items in an area.

Example:

	pdgreppe -x ^{.*orange.*&.*apple.*&.*banana.*}$ ere.def

as a command with option -x will try find an area having

	"orange" AND "apple" AND "banana"

in the file named ERE.DEF between a StartOfLine (^) and
some EndOfLine ($).

It does this irregardless if the fruit names are on separate
lines, in the current search window with a window width set by
option -w.

A command without option -x does not find the fruit:


	pdgreppe -Hjc "^{.*orange.*&.*apple.*&.*banana.*}$" ere.def


However with option -x the fruit is found:


	pdgreppe -Hjc -x "^{.*orange.*&.*apple.*&.*banana.*}$" ere.def


Or a command like:


	pdgreppe -Hjc "MAGIC|fixed" file_id.diz


...finds "MAGIC" OR "fixed" individually in file_id.diz.

while a command like:


	pdgreppe -Hjc -x ".*MAGIC.*$&.*fixed.*$" file_id.diz


..."-x" gives ".*MAGIC.*$&.*fixed.*$".  That is, "MAGIC" AND
"fixed", from a start of a line, to the end of a line ($).

Note:

This option will attempt to limit the Start-Of-A-Match to any
Start-Of-Line (SOL) point before the first LITERAL match point
in a pattern.  So a pattern like

	.*X

that finds a LITERAL X in data and will try to place the start
of a match at a SOL before X.  The possible width of the match
then extends from the SOL up through the LAST X in the area and
is less than or equal to the width in bytes given by option
-w<d>.

If a SOL is not found before X, then the width of the match
extends from the Start-of-the-Search-Buffer up through X to the
maximum width given by -w<d>.

Hint:

Use option -w<d> with a WIDE setting for <d> for simple AND
operations with option -x.

Descriptions of Individual Options : END
************

Option Notes:

If You are going to make regular use of PDGREPPE, it is important
to know the GLOBAL effects of options like

-i	  letters in pattern are case Insensitive.
-E	  Exclude Search Magic "^$[].(){}<>#%-/;!?*+&|~`'@:,=" unless '\'.
-W	  White Space for clarity in pattern.

These can affect Pattern Definitions and anything else that
makes or matches with patterns.

Other GLOBAL pattern options that should be considered are:

-@<d>	  file(s) for Search pattern @Definitions.
-L	  all in pattern are Literal search.
-jg	  allow Global (Marked Group) Search references (% or #).
-jv<d>	  Variable name character range is <d>.
-jw<d>	  Word character range is [<d>].
-jN<d>	  Search (% or #) and Replace (%+-?) (Marked Group) Number Start.
-jX<d>	  eXclude <d> of "^$[].(){}<>#%-/;!?*+&|~`'@:,=" from Magic like -E.

If editing these options can affect the replacement pattern:

-kg	  allow Global (Marked Group) Replace references (%+-?).
-kE	  Escape by backslash \ before edit characters {}%+?-&:,.
-kL	  all are Literal replace for edit.
-kW	  White Space for clarity in edit pattern.
-kX<d>	  eXclude <d> of "{}%+?-&:@," from Magic Replace like option -kE.
-k@<d>	  file(s) for Replace pattern @Definitions.

Also, as noted in main options information, command line options
are processed sequentially or one after another.

So these options, and the search/replace pattern, should be
given BEFORE the appearance of a data(file) specification in a
command line.

[ < < < Home ] [ < < Reference Start ] [ < Reference Contents ]
[ < Previous=PDL - Pattern Definition Language ] [ Next=FGREPPE 3.13 > ]

Intelligence Services

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