[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: Wildcard question



Reply to note from Bill Troop  Sat, 24 Nov 2001
17:51:19 -0500

> I want to search for "single carriage return" (alt shift R on
> the Xy4 keyboard) and replace it with a standard DOS carriage
> return/linefeed pair (alt shift Enter on the Xy4 keyboard). How
> do I get these things into a search string inside of a program?

Issue DECODE to decode the reply that follows:

XPLeNCODE v2.0
b-gin [UNTITLED]
There are two ways to do what you want, one with wildcards an
d the other with string literals:[cr|lf][cr|lf][BX_]ci /[255+
192+145]/[wC]/[Q2_];*; wildcards for 13 and 13+10, respective
ly[cr|lf][cr|lf]or[cr|lf][cr|lf][BX_]ci /{13}/[cr|lf]/[Q2_];*
; literal 13 and literal 13+10 [cr|lf][cr|lf]Using the space{32}
as the separator, these can be shortened to:[cr|lf][cr|lf][BX
_]ci [255+192+145] [wC][Q2_];*; wildcards[cr|lf][cr|lf]and[c
r|lf][cr|lf][BX_]ci {13} [cr|lf][Q2_];*; literal 13 and 13+1
0[cr|lf][cr|lf]The Ascii-13 wildcard [255+192+145] is produce
d by executing func NN (which waits for a character) followed
 by an Ascii-17. (See the assignment for Alt-Shift-R in XY4.
KBD and the table below.) The CrLf (13+10) wildcard [wC] is{32}
produced by executing func WC. (See table below.)[cr|lf][cr|
lf]Note that within a BX...Q2 statement, the wildcards must a
ppear literally, not as functions to be executed (i.e., "[wC]
" not "[WC_]"). (Functions appearing within BX...Q2 statemen
ts do *not* execute, but stand literally for themselves. Thu
s, [BX_]se "[DF_]"[Q2_] finds the string literal "[DF_]"; it{32}
does not open or close a DeFined block.[cr|lf][cr|lf]> It wou
ld also be interesting to know how to get other of the[cr|lf]
> search wildcards into a program.[cr|lf][cr|lf]Consult the f
ollowing table:[cr|lf][cr|lf]{<}IP{>}{<}RT1{>}{<}TS10DI,36DI,
47DI,56DI{>}[cr|lf]{tab}{tab} Produced by:[cr|lf]Wildcard{tab
}Meaning{tab}KBD file{tab}XPL[cr|lf]-------{tab}-------{tab}-
-------{tab}---[cr|lf][wA]{tab}Any alphanumeric{tab}WA{tab}[W
A_][cr|lf][wL]{tab}Any letter{tab}WL{tab}[WL_][cr|lf][wN]{tab
}Any (single) number{tab}WN{tab}[WN_][cr|lf][wS]{tab}Any sepa
rator{tab}WS{tab}[WS_][cr|lf][wW]{tab}Any 1-80 chars (bytes){
tab}WW{tab}[WW_][cr|lf][wX]{tab}Any single character{tab}WX{t
ab}[WX_][cr|lf][wC]{tab}Carriage return{tab}WC{tab}[WC_][cr|l
f][w]{tab}Ascii-10 line feed{tab}NN{25}{tab}[NN_]{25}[cr|lf]
[255+192+145]{tab}Ascii-13 carr. return{tab}NN[255+49+49]{tab
}[NN_][255+49+49][cr|lf][255+192+174]{tab}Sentence separator{32}
[.!?]{tab}NN.{tab}
[NN_].[cr|lf][wO]{tab}Logical OR{tab}NNO{tab}[NN_]O[cr|lf][w-
]{tab}Not [next char]{tab}NN-{tab}[NN_]-[cr|lf][w0]-[w9]  {32}
 Repeat next char or[cr|lf]{tab} wildcard 0-999 times{tab}N
N0...NN9{tab}[NN_]0...[NN_]9[cr|lf][cr|lf]
-nd
XPLeNCODE

See also the following Jumbo U2 routines:

{cr210} Change Carriage Return 13|10 to Ascii-10, from  to EOF
(for Unix)
{cr213} Change Carriage Return 13|10 to Ascii-13, from  to EOF
(for DOS)
{from102cr} Regularize 10 to 13+10 , from  to
EOF
{from132cr} Regularize 13 to 13+10 , from  to
EOF
{Wildcard} Access all SEarch wildcards from a single key

--
Carl Distefano
cld@xxxxxxxx
http://users.datarealm.com/xywwweb/