Bert, Your understanding of the multipasss algorithm is correct. The documentation can certainly be improved. I am still investigatting the infinite loop that Christian reported a while ago. It is caused by some sort of raare condition. John On Wed, Nov 24, 2010 at 03:10:01PM +0100, Bert Frees wrote: > Maybe that multiple pairs of square brackets in a single expression are > not allowed? Also, to me it was not entirely clear at first how text is > evaluated with multipass expressions. I think the algorithm looks > something like this (John, correct me if I'm wrong): > > * Begin with pass1 (context) > START LOOP > ** Match the text following the cursor against all expressions in the > current pass > ** If there is no match: shift the cursor one position to the right and > CONTINUE loop > ** If there is a match: choose the *longest match* > ** Do the replacement (everything between square brackets) > ** Place the cursor *after the replaced text* > END LOOP > * Go to pass2 and START LOOP > * etc. > > I think this is not explained clear enough in the documentation. > > Bert > > On 24/11/2010 13:44, Christian Egli wrote: > >Bert Frees<bert.frees@xxxxxxxxxxxxxxxx> writes: > > > >>Try this: > >> > >>swapcd digit 0123456789 245,1,12,14,145,15,124,1245,125,24 > >>context $d1-2["-"%digit1-2"-"]$d2-4 @3456%digit > >Do you have any suggestions to improve the documentation? > > > >Thanks > > > -- My websites: GodTouches Digital Ministry, Inc. http://www.godtouches.org Abilitiessoft, Inc. http://www.abilitiessoft.com Location: Madison, WI, USA For a description of the software, to download it and links to project pages go to http://www.abilitiessoft.com