On 5/28/24 20:06, Hans Hagen wrote:
> On 5/28/2024 6:25 PM, Tomáš Hála wrote:
>> Hi Pablo,
>>
>> unfortunately, that it is not possible:
>>
>> http://lua-users.org/wiki/PatternsTutorial, section Limitations.
>
> \starttext
>       \startTEXpage[pagestate=start, offset=1em]
>          \startluacode
>              local pat = (lpeg.Cmt(lpeg.P("this") + lpeg.P("that"),
> function(str,_,s)
>                  context(s)
>                  return #str
>              end) + lpeg.P(1))^1
>              lpeg.match(pat,"how about this being that")
>
>              local pat = (lpeg.Cmt(lpeg.oneof({ "this", "that" }),
> function(str,_,s)
>                  context(s)
>                  return #str
>              end) + lpeg.P(1))^1
>              lpeg.match(pat,"how about this being that")
>          \stopluacode
>       \stopTEXpage
> \stoptext

Many thanks for your reply, Hans.

I will have to study it becasue LPEGs is new stuff for me.

Many thanks for your help,

Pablo

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to