On Mon, 20 Jan 2025, at 06:53, J Leslie Turriff via Oorexx-users wrote:
> This is the first time I have tried to use rxregexp, and I'm obviously 
> misunderstanding something.
> Here's the pertinent bit of code I've written:

I would have tried something simpler as my first example ... yours is hard
to read because of all the special symbols in html.

> | say '-' ~ copies(80)
> | say "partLine["L"] = '"partLine[L] ~ left(60)"...'"
> | say " pattern["1"] = '"pattern[1]"'"
> | call trace ?i
> |     if regexp ~ parse(pattern[1]) = 0 then
> |       if regexp ~ match(partLine[L]) then
> |         do
> |           starts =      pos(partLine[L])

I think this is wrong.  "pos()" is a standard string function, which looks for
the position of one string in another., and with onluy parameter wouldn't
do anything useful anyway,

Don't you need to be using something specific to the regex that you compiled
(assuming that's what the regexp~parse() did?

That is   regexp~pos() .   Likewise regexp~position ...

If I were you I'd experiment with the examples shown in the reference manual.

-- 
Jeremy Nicoll - my opinions are my own.


_______________________________________________
Oorexx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to