Re: Wondering what I'm doing wrong?

"Tim Bradshaw (as tfb at cley dot com)" <[email protected]> Tue, 9 Jun 2026 19:25:39 +0100
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
Is this an RTFM problem? From TFM

*allow-named-registers*

If this value is true (the default is NIL), CL-PPCRE will support (?<name>"<regex>")and \k<name> in regex strings to provide named registers and back-references as in AllegroCL .

Isn't that what you want?

--tim

On 9 Jun 2026, at 18:44, David McClain <[email protected]> wrote:

Well, as I stated, I have never used Perl. But I did study Finite Automata back in the early 90’s at UofAz.

And for myself, the string regexps are all I need, with the addition of named sub-patterns. The sexpr version that these compile into are presumably correct, but they denote another language for which I don’t really know all the rules.

The only irritating thing I have run into with the string regexps is that to enclose a group so that you can add a +,*,or ? afterward, also causes the group to be recorded in a “register” (to use the PPCRE terminology). This is not always desired, and I can see that by using the sexpr language they could be avoided.

So when I do use the sexp version, I first code up an exemplar with a string regexp pattern, and watch what comes out after calling CL-PPCRE:PARSE-STRING against it. That allows me to fumble around in the dark, and it has worked so far.

But the question remains. Why has this named subpattern facility been ignored in both LW and CL-PPCRE string regexp patterns? Perl seems happy to comply with an extended syntax. Has nobody needed this except me?

[one of the very first things I wrote for myself, back in 1994, was a REGEXP package using an NFA engine - and it definitely included the named subpattern facility.]

On Jun 9, 2026, at 07:52, Tim Bradshaw (as tfb at cley dot com) <[email protected]> wrote:

On 9 Jun 2026, at 11:25, David McClain (as dbm at refined-audiometrics dot com) <[email protected]> wrote:

You *can* do this by writing out CL-PPCRE parse trees by hand. But not embedded within regexp pattern strings.

Surely this is yet another reason to use cl-ppcre's sexp syntax? Less like line noise, more flexible, and you can make it generate bits of it for you if you know the stringy thing. What's not to love?

--tom

_______________________________________________

Lisp Hug - the mailing list for LispWorks users

[email protected]

http://www.lispworks.com/support/lisp-hug.html

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html