--- In [email protected], "brucexs" <[EMAIL PROTECTED]> wrote:

> I also don't understand how extract is supposed to work.

I gave it some study, it definitely is not working now.

Extract is supposed to act like Replace (i.e., not global) with an
extra argument that captures only the rewritten portion of the string.
No replacements should be made in the actual string.

local pat=?"(\w+)"
local myreplace=?"*\1*"
local out
local s = "yabba dabba doo"
local num=re.create(pat).Extract(myreplace, "s", "out")
win.debug("Extract says ", num, s, out, ?"(we were ;;+
expecting *yabba* not *s*)")
s = "yabba dabba doo"
local num=re.create(pat).Replace(myreplace, "s")
win.debugshow("Replace says ", num, s)


To extract all (if it were working) apparently would take a loop using
the Consume service. Are there tests for Consume, FindandConsume,
StringPiece?

Regards,
Sheri

Reply via email to