!d@{x2e@ @J@@@@T@@4@@`@0= 8R@!Б@A@@(@P@@x@f@0@@@@P3@@P3@@@@@p@H  ':BCEHKLOSUVZ]`H2UpMvpUXcR@R@J@J@PS@S@S@S@S@T@@T@T@T@T@T@(U@PU@U@U@U@V@0V@PV@V@V@V@PW@W@W@ X@@X@X@X@X@Y@8Y@pY@Y@Y@(Z@HZ@Z@Z@[@8[@h[@[@[@H\@\@\@]@@]@]@]@]@^@^@_@ _@@_@ X_@ x_@ _@ _@ _@ `@ 8`@ ``@ `@ `@ `@ `@ 8a@ Xa@ pa@ a@ a@a@b@(b@Xb@xb@b@b@b@b@c@(c@Hc@pc@c@c@c@c@d@(d@Pd@pd@d@d@X!@pO"@DeFP"@sRh"@rEp"@hId#@sRHx%%%'Search/Replace functions DanB 2000+'!"HP <23%456789):;01< !"P@99oSr osr sR;io;AlL;hId;rEp;sRh;DeF;98;97;pO;pU;96;95;lU;Mv;94;Up;0;1;2;93;92;91;90940P(@93'Object Search and Replace for SAX - DanB (c) V5.02'uietP0@io0+@ x@(nc 'oSr')/2 @oSrnl 3 @) @3,940sR (h@(940101oSr)3:@(@u@93211,(,1)20,(2size 11),1@(@93[2]1[2]2[2]0*@(0hy@oSr93[3]-950,93[3],0ts*@0(Q@48@oSr1(111oSr' ')/oSr,' ',oSr8(@ 99'ARG length error'(8+@20(91/91sR1sR),sR08Ph?@9712 2 12 'btcalr=;inqBTCALRINQ'10[1]sRresultP к@2[11]598AlL @93;6@ @99(~2[6])0 @(^/2[7 8])22 Xx@lU2 27AlL'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'*@X @AlLAlL,'_'sRh (@AlLAlL,'0123456789'*@(``@90'io1L1L-1+1L(~D)/DDMV,D1VM(D)(,DL./L,D0)\D/M'6789_`@(y@90fx((90)'MMv V;D;L;io'),[0.1] 90oSr@H@90fx Mv 'rs pO p;tsspr\s\t10,ts/p' 20HHF@90fx Mv 'rs pU p;tr\ps\t10,ts/\10,p'@H  2@2[9]7)/LDeF @R@90'BB/BR[B]lU[0;27(,1 0lU)R[B]]'@Hw@90fx Mv 'RUp R;B(/BRlU[1;])0',90made.'eH 2@91[0]02/L98 (@9393/93\910*@((0@sR[93]Up sR[93]*@(8*@ 98931,'',[0.1] 2[3]/'BTC'9(88P*@(sR(111)/10[1]sR)22~SAM88)@1(10)-101-11-1110 fn8H #@90'BCTT>CL pO(M'''')>TTL pU TM'''''''''H P:@2[3]8/L_97 HX(@9090,'A(9''trap''A)(''nc''A)''''=A,M'C@H8)@9090,'BCTT>(LB^M'''')pO A'88P$@91'RV hId M;L;C;T;B;AR~LM=1M'885@92fx Mv 91,98/90,'RR>',93n80x@91(/2[4 5])/'s1~tAlL'0P2@90'rV sRh t;b;w;m;h;z;n;s;ir0 2i0n1m~V hId t',91P@Hx@9090,(/2[7 8])/'h11h/ht=1t'F'20@PN@9090,'l:zsR[0[2i]+w1[i]]',(4~2[9])'Up t'ctions8P@v@9090,(/2[7 8])/'(',2[7]'~/hz)e'@0(@92(2 8 /2[4 5])/'^s^(1+w)s'0Hx@9090,'zz/zmii+z1)/lrr[r;]'8 h@92fx Mv 90 @90'L22[wP[;1]]L1(1,0)[w]K(B,T)-0,L1+BP[;0]B(2K)1 0T((,K,[.1]L1,0)/B)/TT((,K,[.1]L2,0)/B)\TT[B+L2/+\1K]sR[(B+/L2)+L2/0[1+2w]-10,+\L2]'BLH`w@92fx((90)'TP rEp T;K;L1;L2;B;w'),[0.2] 90@899H(H@2(2,0.51)1*@( 1@12[;0]0pU h1@22[;1]L_96 &@94/21 @(oSr)2295 (D@91(oSr' ')oSr )((C@(91'sR')/20 ] L100:((Q@(962nc 91)/1898(((xP@(91'osr')/20 pt ( Q@(91'oss')/20 (O@(91'OSSPATMATCH')/20( @DeFcr 91Mv @@(092''9096 sRh DeF,av[10],DeF)/20@ @DeF90 rEp DeF :@96/13@`@(909999+9290~0103 fd 1DeF)/20'@ @'Not ',91Up ȴ@20;i@ @962>930 P@DeF96DeF1 (&@96/168"@90DeF((193),190)90Mv DeF8((R@(0.>9693-90)4(0H@(0' '=(93(-93)1)DeF)40 J@DeF96DeF2 -@9999+9293: l@94/17 @91,'DeF'92 0@20;*@(Xu@DeF replace 2oSr(@21;*@ @DeF9191 (P@ (2pnames DeF)20 ((0@(' '10DeF)20( x@93DeF90t @10;*@&@94/21(0P@oSr(1+91)oSr(a@9;*@(PN@(/1oSroSr+95)/22( @DeFread 2oSr @19,961 AlL Pk@(99)0hId 8y@99(99),' replacements made.'ext_948X F !"#$%&'()*+,-./01X10RePouPrRnEmVlUSrHPaTHiDAlLRzoSrwp@d@ o@@e@p@p@q@(q@Pq@xq@q@q@r@(r@Hr@`r@r@r@r@s@0s@`s@xs@s@s@s@t@0t@Pt@pt@t@t@t@u@8u@hu@u@u@v@@v@v@v@w@@w@w@ w@ w@ x@ hx@ x@ x@ y@ Py@ xy@y@z@ z@Xz@z@z@{@ {@h{@{@{@|@P|@|@}@(}@@}@`}@x}@}@}@}@~@@~@h~@~@~@~@~@@8@p@@@@ @P@x@@@؀@@@@@p@@@Ё@@@X@@@@@8@`@@@@@@ @P@p@@@88C@89D@90XD@91D@92D@93 E@94pE@95E@96E@97F@98F@99G@eXn`G@SrG@nLG@XF %&)*-./1345:<=CLU\]adjlmpu:;c(XHy@RznL oss Sr;io;eXn;99;98;97;96;95;94;93;92;91;90;89;88;AlL;HiD;PaT;SrH;lU;mV;nE;rR;uP;Po;Re;0;1;ppH@93'Object Search String for SAX - DanB (c) V5.48'2H@pp16 \@PaTio960 (z@99'p<[>q<]>i5,x1'((@{@(2pnames Sr)4((h{@8989/89Sr1Sr(@(p@902 16'btcalr;inp0dqBTCALR=;INP0DQ'@({@9090(1189)Sr( @Re90[14]` h@90[15]2Sr j@93@ H@(nc 'nL')/3 H~@nLnl 3,Re/2 ({@(960101nL)4B@(@H@929111,(,1)910,(2size 11),1@({@92[2]91[2]1[2]+1B@(0 m@nL92[3]-880,92[3],00@5;}B@8X@nL1(93193nL' ')/nL,' ',nL;8(|@(2=pnames Sr)5B@( v@pdef Sr980 P@20;cB@ h@ 089,Sr97 @rR90[6]96 p@nE90[10]95 V@92~90[12]94 0@Rz(0,92/rR942+0)0csc0h'@94318@94921,'',[0.1]90[3]/'btc'208(0|@(^/90[7 8])31 㐣B@(0x@Sr(111)/10[1]Srisvar08"@1(10)-101-11-1110Sr8Xx@lU2 27AlL'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'0X N@AlLAlL,'_'93 (X|@AlLAlL,'0123456789'B@(``@93'io1l1l-1+1l(~b)/bdmv,d1vm(b)(,bl./0,bl)\b/m'm1' `@@93fx((93)'mmV v;b;d;l;io'),[0.1]93@ 0N@90[9]992p @@93'bb/br[b]lU[0;27(,1 0lU)r[b]]'0'@HHn@93fx mV 'ruP r;b(/br1 0lU)0',938t8DYWH N@SruP Sr91 @Re10P@93'Zrp8 eXn o2;n;t;eXnn40t''eXn'',,'';'',pnames p8'PXH@93fx mV 93,'fx(2,n)(nt),n''pdef p8Zr(pnames p8)oss o2'''0XHx@93fx mV 'RS Po P;TSSPR\S\T10,TS/P'H@`@93'bctt>c\(m'''')>tt\tm'''''''''@ PV@90[3]1490 @v@9393,'bctt>(m)(,1,0 1b^m'''')'DYW@(|@98'''a)''''=a,m'(0!@9393,'Po(9''trap',98810X@@930fx mV 'mHiD m;c;t;b;a',(94/93,'m~',92),(~94)/'m1'YZ0X W@93';trap'89 8#@93'rSrH t;h;m;s;n;S;i;w',93end_948PPz@9393,'(0st)ri0',(rR/'r0'),'mHiD tn1'p',98P @92~90[13]88 85@9393,92/'trap''0 e er0'''AM8 X@89/90[4 5] HX(@9393,(89/'S1~tAlL'),'t',(90[9]/'uP'),',t'9H @98/90[7 8] H #@9393,'l:wSr[0[i]+1[i]]rr',rR'',rR/',+/,'H@Hx@9209393,98/'(',90[8]'~1s[1]h)^h''@@R@98(1-90[11]98)98'',92,'OSSPATMATCH'@`p@9393,(2rR94)'m^(sw ',98,' t)',(90[4]/'^S'),90[5]/'^(1+1[i])S'789_`PP@93fx mV 93,'(n>ii+1)/l',(~rR)/'r0 1r',94/'^m',92P(P@rR(2rR)*~90[12]B@( @96/30 H@(nL)31PaT @980 @(X@89(nL' ')nL )((@('Sr'89)27 @B@(0(@(971939 2nc 89)23t0 @('oss'89)27 (K@('osr'89)27 ((K@('OSSPATMATCH'89)27( @@92cr 89lU 0x@(+/,93SrH 92,av[255])27S08@9893  @(rR)27 mV @91/93 nE ( L@98+/,939193hNB@(8P$@90(2 6' VAR ')[97;],PaT,898P5@''@0hy@90,' (',(98),' found)'s'00 @90-+/^\' '=929192AlL'08)@(,99 fmt 911),90[0]92[0;] l/r80v@' ',(90[0]93[0;])\'^'0(HL@(0931 093)/27NB@( @921 092rR @91[911]0uP @90190 Po H@22; B@ h@ 926 ws 89 0@ (2pnames 92)Re27,2600V@(nE93' '1092)270 8@(nE>93)25e >@9292 1 n@(292)/21T (pL@92mV,av[10],92pVB@(@@21;B@Hw@94('Rz' pack 0Rz)pins 'PaT' pack PaT,89,'.'C@Hhn@9192 eXn 94 pins pack'Sr AlL HiD eXn SrH Po uP lU 1 0 rR nE Re mV'0 h n@(0=rR)29Sr @9891 Xo@(1=rR)27AlL @98+91HiD (L@(0 2=rR)/29,28] WB@(  ~@98<98eXn O@RzRz,[0]98 8@96/30(o@nL(1+89)nL] mB@(@20;@(o@(/1nLnL+88)31(0w@PaT'Cpt ',(12nL),': '~+@0 @92read 2nL @8997980 @24;@ @;@h "#$%&'()*+,hNULLNCzsxiregfreeregexecregcompptrecodeall.@P@'@@@P@@@0@`@x@@ @ (@ h@ @ @@@(@H@`@x@@Ѝ@@@H@x@@@@ @(@h@ @ @@@ @@@ X@!x@"@#@$Ȑ@% @&P@@ . #ar@p8@rpattern OSSPATMATCH string;io;all;code;e;ptr;regcomp;regerror;regexec;regfree;sxi;z;C;N;NULLpPgfe This function is used in conjunction with to find wherePX@ the pattern is found. It returns a boolean list indicating the startXXX[@ of each match. If a subexpression is specified it is shown instead.0X0@ This fn is io independent.00Ȼ@ pattern may be overlapping.P@0@H@00w@ Define the regex functions: 0@}@ 'regex.regexec' bind 'regexec' SAX@@@ 'regex.regcomp' bind 'regcomp' SAX@@@ 'regex.regerror' bind 'regerror' SAX@@h4@ 'regex.regfree' bind 'regfree' SAX@P@H@0 @ r(string)0 default result0R@ io0  @ z4Ң1 W SAX @ C32' ' @ @ N''H@@;H@8Y@ allow to show 1st subexpression:endif8 @ e'('=pattern 0X@ sxi2/e^'\'1'x',pattern0@;H@0@ compile the expression into C00@ coderegcomp Cpattern50 @ codeerrxi@ Pn@;H@@a@ execute the expression until nothing found@@ ptr0@ 0 @:while 1 0@ @>@ coderegexec C((ptrstring),N)2z0N''@ @ :If code H@ P @ :leave NYW "@ :endif(@ r[ptr+z[sxi]]1(8@ ptrptr+1+z[0] allow overlapsageng8  @:EndWhileNULL @;H@ 8@ zregfree, will, by default, display the lines where the strings are found with a caret (^) below. It then returns a 00 result. It can also return an integer table with as many rows as objects were searched and as many columns as strings were looked for. For example, if all 20 functions of a workspace were searched for 3 strings then a 20 by 3 integer table of the number of hits per fn/string would be returned. To get this result specify '' as method. can also return a boolean mask of hits instead, one per object scanned. Each mask has the same shape as the of the variable or cr of the function or scalar 0 if no match. For example, 'var1 fn2' oss '/0/STR' would return a 2 element result showing where 'STR' var1 and cr 'fn2'. EXAMPLES oss '//abc' search 'abc' everywhere oss '\\abc\def' search both 'abc' and 'def' everywhere oss ';r;abc' search names ending in '...abc' 'x y' oss '$ct$abc$f' syntactic search of 'abc' and 'f' in objects 'x' and 'y' not within text or comments In the following example we have a file of CRs of functions and we want to know where variables 'x' and 'yz' are used AND not localized: 8 11 oss'/lr;cat/x/yz' look for 'x' and 'yz' as exact names ('lr') in file tied to 8 starting at component 11. Don't look in comments or text ('ct') except where is concerned ('a') and exclude where localized (';'). 'F G' oss '/lri/x/y/z' return a 23 of the number of hits in each of and for lower and uppercase names 'x', 'y' and 'z'. If a pattern matching function exists in the workspace it can be called to do the search. Simply edit function to call that function like this: rpattern OSSPATMATCH string [1] rpattern Pmatch_fn string or whatever syntax is necessary It MUST return a boolean result. For example, if we wish to find out which strings contain a filename, that is "possibly some spaces, a library number, some spaces, a name, possibly some spaces", we'd do: 'a b' oss '/pc/'' *[0-9]+ +[a-Z]+ *''' for and look for a filename within quotes. LIMITATIONS will search functions, variables and files. This version will also look at packages. If a name is a package it is treated like any other name. To search within it use the "recursive" method. If no left argument is supplied then only the functions in the workspace are searched. For Dyalog APL the OSSPATMATCH function must reside in the root namespace (#). Using ';' and '' as method only makes sense for syntactic search in fns. will simply look for the string in the first line of the object and decide what to do from there. trap strings are searched starting at the 4th character so number and action code will be searched. looking for 'e' as a variable could be found in trap. OSSPATMATCH is provided with an example of use with the logos pattern matching functions. These are available separatly through Soliton. DanB 1991 p`' == This function will search and replace all occurences of strings and their. Left argument is either a list of names (space delimited or matrix) or file descriptor of file to act upon. Syntax is: [tienonamelist] osr '/[method]/string1/repl1/string2/repl2/...' where '/' is any delimiter and 'method' a series of characters describing the behaviour of the function as follows (it is the same as ): B DO NOT search the object's Body T DO NOT search the object's Text within quotes C DO NOT search the object's text after the first lamp () character not within quotes A consider text after , nc and trap as APL code (Body) ; exclude localized items exclude global items L perform a left syntactic search R perform a right syntactic search return a number as opposed to a string By syntactic search is meant not preceeded (or followed) by a letter, digit, , , , _ or characters. If a file is to be changed, the left argument is 1 to 4 integers of: tie number, start component, last component, step. Default is all the file. Examples: osr '//abc/def replace 'abc' by 'def' everywhere osr '..abc.A.def.FF' replace 'abc' by 'A' and 'def' by 'FF' everywhere osr ';r;abc;X' replace name endings in '...abc' by 'X' 'x y' osr '.lrCt .abc.f' syntactic replacement of 'abc' by 'f' in objects x and y not within text or comments 2 3 7 osr '/lr/AA/drunk' replace all 'AA' strings by 'drunk' in file tied to 2, from components 3 to 7 LIMITATIONS The function suffers the same limitations as . Furthermore, the size of variables may change upon performing changes, especially those padded with blanks at the end. Packages and numbers are not changed. DanB 1991p `( % "(@pattern@ossXstring@rc @OSSPATMATCHd p@osrcdd(.,**_(                     $  []();/\+-*^<=>,!?~_ܭ}{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789. ':  |`#@"%&徼е뱿    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     ذ@   xذ@@@@`@H@0@@@@Я@@@p@P@0@@@Ь@@@p@P@x@@errce@@H@@f@`@PK@p@(@@@0@@@@Ѕ@@@@@p@X@@@(@f@o@o@ xo@`o@Ho@0o@o@o@n@n@n@n@n@pn@Xn@xf@`f@Hf@0f@f@&f@e@e@e@%e@e@pe@Xe@ f@ R@-R@Q@Q@1Q@Q@.8K@3 K@*K@9J@@@@X@d06<2 +/7 8):,;"! '$#( >=45