On Monday 20 January 2025 20:25:24 Jeremy Nicoll wrote:
> 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.

        Well, darn; you've put your finger right on the mistake that I made!  Of
course those methods need to be members of the regexp class.  That's the sort
of thing that happens to a classic Rexx programmer who only half-understands
the OO paradigms...
        Thanks very much.

Leslie
--
Platform: Linux
Distribution: openSUSE Leap 15.6 - x86_64
Open Object Rexx Version 5.0.0 r12583
Build date: Dec 23 2022
Addressing mode: 64


_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to