Hi,

For those who like playing around you can use lua pettern matching in a match loop:

\starttext

\doloopovermatch
    {(\letterpercent w+) *(\letterpercent w*)}
    {aa bb cc dd}
    {
      [
        \doloopovermatch
          {(\letterpercent w)(\letterpercent w)}
          {#1}
          {(##1 ##2)}
        \doloopovermatch
          {(\letterpercent w)(\letterpercent w)}
          {#2}
          {(##1 ##2)}
      ]
    }

\blank

\doloopovermatch
  {(\letterpercent d+)}
  {this 1 is 22 a 333 test}
  { [#1] }

\blank

\doloopovermatch
    {(.-)\letterpercent{\bf (.-)\letterpercent}(.*)}
    {this is {\bf a} test}
    {#1{\it not #2}#3}

\blank

\doloopovermatch
  {([\letterpercent w]+)}
  {\cldloadfile{tufte.tex}}
  { [#1] }

\stoptext

Probably not that useful (I never needed it but that doesn't say much) but it fits in the repertoire of loops.

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to