On Sat, 19 Apr 2008, Jeff Johnson wrote:

A little reading indicates that I have inadvertently worded my question re a PCRE <-> POSIX conversion "implementation" incorrectly.
 ...
I was hoping that the _SYNTAX_ can be interconverted for a significant subset of all possible PCRE <-> POSIX expressions. I'm perfectly willing to try a imperfect, known flawed, interconversion of _SYNTAX_ if the patterns that are typically needed by RPM can be mostly converted reliably.

Note: "significant" and "typically needed". YMMV, as always.

I think this article encapsulates the issue I was noting in my IRC remarks yesterday, mentioning classical Unix, FSF, procmail <!>, and other varaints;
   http://en.wikipedia.org/wiki/Regular_expression

[ Perl has a more predictable and much richer syntax than the [ POSIX basic (BRE) and extended (ERE) regular expression [ standards. ... other utilities ... have adopted syntax [ similar to Perl's — for example ... PCRE ... [and others not [ listed each] use regular expression syntax similar to Perl's

That is, there has been a 'pick and choose' over time, and of course a series of 'improvements' and 'regularizations'

The implied requirement of a quest to find a prebuilt tool to automatically do all possible inverse transforms, from the initial use of the bare '<->', was probably doomed to 'no reply' -- The article notes that there is an incompatible even in the standard for simplest variation of POSIX 'basic' and 'extended' forms:

[ The meaning of metacharacters escaped with a backslash is [ reversed for some characters in the POSIX Extended Regular [ Expression (ERE) syntax

so absent an option switch, no 'perfect' inverset (',-.') set of transform can exist. Move a few generations away into PRCE and ...

-- Russ herrold
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
Developer Communication List                        [email protected]

Reply via email to