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

Intelligence Services

PDGREPPE Escape Byte

Escaped bytes are ones that have been converted to some other
value.

If the byte was originally magic, then an escape makes it
NON-magic.

If the byte was originally NON-magic, an escape makes it magic,
if the byte is recognised by PDGREPPE as one of its magic
symbols.  Otherwise it retains its normal value.

To escape a byte use a standard backslash '\'.


        pdgreppe -Hjc -1 "." file_id.diz


...will find the first (-1) ANY "." byte on each non-empty line of
file_id.diz


        pdgreppe -Hjc -1 "\." file_id.diz


...will find the period "." bytes in file_id.diz because the
magic symbol "." has been escaped by "\" to become "\.".

Options -E and -jX<d>:

To assist in the entry of LITERAL BYTES, that resemble MAGIC
SYMBOLS, the option "-E" may be given on the command line, in
which case any Magic Character is expected to be escaped, e.g.
"\?" to become magic.

The option "-E" is useful when entering bytes as literal bytes
(bytes that just represent themselves) that would otherwise
be considered magic like any of

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

AND at the same time entering a few MAGIC symbols that can be
escaped with the backslash character (\).

 \<char> next character in [^$[].(){}<>#%-/;!?*+&|~`'@:,=] is MAGIC (option -E)

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


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


...search for literal "^$[].(){}<>#%-/;!?*+&|~`'@:,=" does NOT work
because there are MAGIC rules for using MAGIC symbols (any of
^$[].(){}<>#%-/;!?*+&|~`'@:,=).


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


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

finds

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

because it is now a literal string by option -E.


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


..."\^\$\[\]\.\(\)\{\}\<\>\#\%\-\/\;\!\?\*\+\&\|\~\`\'\@\:\,\=" finds
"^$[].(){}<>#%-/;!?*+&|~`'@:,=" because it is now a literal string
WITHOUT option -E and with each MAGIC character escaped by "\".

Another way to have any magic character in

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

or non-magic character in

        ["_]

be interpreted as a literal character is to use its decimal
character number as shown by using PDGREPPE with option -I:

 Special Character Decimal Numbers

 Magic Symbol Escape Numbers:

 !      \033    Exclamation Point
 #      \035    Hash Mark
 $      \036    Dollar Sign
 %      \037    Percent Sign
 &  \038    Ampersand
 '      \039    Trailing Single Quote
 (      \040    Left Parenthesis
 )      \041    Right Parenthesis
 *      \042    Asterisk
 +      \043    Plus Sign
 ,      \044    Comma
 -      \045    Minus Sign or Hyphen
 .      \046    Period or Full Stop
 /      \047    Forward Slash or Division Sign
 :      \058    Colon
 ;      \059    Semi-Colon
 <   \060    Left Pointer or Less-Than Sign
 =      \061    Equal Sign
 >   \062    Right Pointer or Greater-Than Sign
 ?      \063    Question Mark
 @      \064    At Symbol
 [      \091    Left Square Bracket
 \      \092    Back Slash
 ]      \093    Right Square Bracket
 ^      \094    Caret or Exponent Sign
 `      \096    Leading Single Quote
 {      \123    Left Curly Brace
 |      \124    Pipe Sign
 }      \125    Right Curly Brace
 ~      \126    Tilde

 Non-Magic Symbol Escape Numbers:

 "      \034    Double Quote
 _      \095    Underline


        pdgreppe -Hjc "\33\63\42\43" ere.def


..."\33\63\42\43" finds "!?*+" because the pattern is a literal
string with each MAGIC Quantity character given as a decimal
number "\<n>".

"       \034

One way to get around putting a double quote character into a
command line option is to use its escaped number equivalent
of \34 or \034 or simply \Q.

Also, the option

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

specifies a subset of magic symbols to be excluded from being
magic.

(If -jX<d> is used in conjunction with -E then <d> of -jX<d>
specifies the symbols that ARE considered Magic.)

Note:

If the last byte in a Command Line Pattern is a BackSlash that
is not ITSELF escaped by another single BackSlash, then the
BackSlash is entered as itself.

Also:

See the PDL Pattern Definition Language section on the use of
the BackSlash.

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

Intelligence Services

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