<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 17, 2013 at 2:43 PM, Paul Isambert <span dir="ltr"><<a href="mailto:zappathustra@free.fr" target="_blank">zappathustra@free.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello all,<br>
<br>
This is not really a LuaTeX question, but I ask it here anyway since a<br>
lot of knowledgeable people read this list.<br>
<br>
I’ve been surprised to discover that<br>
<br>
    print(string.gsub('abc', '.*', '(%0)'))<br>
<br>
returns<br>
<br>
    (abc)()<br>
<br>
(similarly, “string.gmatch('abc', '.*')” returns two matches). I’d<br>
expect<br>
<br>
    (abc)<br>
<br>
</blockquote></div><br><br>myabe this can help<br clear="all"><br>> print(string.gsub("abc","%s*","(%0)"))<br>()a()b()c()    4<br><br>> print(string.gsub("abc","%S*","(%0)"))<br>
(abc)()    2<br><br>"""<br>A pattern item can be<br><br>a single character class followed by '*', which matches 0 or more repetitions of characters in the class. These repetition items will always match the longest possible sequence;<br>
"""<br><br>-- <br>luigi<br>
</div></div>