chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] regex to be actively deprecated some day?


From: Matt Welland
Subject: [Chicken-users] regex to be actively deprecated some day?
Date: Mon, 7 Sep 2015 19:07:16 -0700

Ok, I sort of panicked when I saw what looked like regex being deprecated (read my original message below if you wish). After re-reading the irregex egg wiki page a few times it looks like all is well assuming these two things:

1. irregex unit will continue to support reading the pcre syntax
2. those using the backslash substitution destination string syntax be prepared to write a parser/converter.

As a request to the developers - please consider adding the function from the regex egg that parses the \N type dest strings to irregex.

Thanks.

Matt
-=-
====== my original "panicked"message =====

From a comment to Chicken-janitors regarding bug #1189 I saw this:

"This seems to be an undocumented feature of the substring-replace
 function, which allows you to escape the backslash. I would recommend
 using irregex, the regex egg's API is kind of deprecated anyway, and it's
 also not very efficient."

Then in the regex egg wiki page I see:

"It is a thin wrapper around the functionality provided by irregex and is mostly intended to keep old code working."

These statements leave me a little concerned as I use the regex egg a fair amount and I don't have the energy to learn yet another abstraction or to go back and rewrite old code. More importantly I expose the use of regexes to users of Megatest and logpro and they have no tolerance for doing something considered a "standard" in a different way, especially if it means using something that looks like Scheme.

From re-reading the irregex egg wiki page I think the only thing I rely on that is missing is the \1 substitution mechanism. Is there an alternative syntax? All I see is the following:
(irregex-replace "(.)(.)" "ab" 2 1 "*")
Which would be implemented using a destination of "\2\1*" in string-substitute. Converting an old-style destination string to the list of numbers and strings would not be too hard I suppose.

Thanks,

Matt
-=-



reply via email to

[Prev in Thread] Current Thread [Next in Thread]