RPM Community Forums

Mailing List Message of <rpm-devel>

Re: Generalizing EVR comparison precedence, preliminaries

From: Michael Jennings <mej@kainx.org>
Date: Fri 02 Jan 2009 - 02:18:56 CET
Message-ID: <20090102011856.GG15433@kainx.org>
On Thursday, 01 January 2009, at 18:47:21 (-0500),
Jeff Johnson wrote:

>>    %evr_tuple_match  ^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$
>
> A little more help please.
>
> I'm using POSIX extended RE's.
>
> With a single call to regexec(3), I'm seeing only 1 {rm_so, rm_eo} matched 
> substring
> returned.
>
> What I'm expecting is what is in the toy sed script, that the tuple {E,V,R}
> is parsed out and 4 substrings, not 1, are returned by a single invocation
> of regexec(3), with sub-patterns that aren't matched being filled in 
> somehow.
>
> I can certainly loop over regexec(3), proceeding to match the next 
> substring,
> if necessary.
>
> But I've never seen nor used RE constructs like
> 	^(?:......)?....$"
> ever in my life.

I'm pretty sure RSE gave you a PCRE, not an ERE.  (?:) inhibits the
assigning of the contents of the parenthesized subgroup to a $123 (or
\123) variable.  I don't believe ERE has anything similar,
unfortunately.

Michael

-- 
Michael Jennings (a.k.a. KainX)  http://www.kainx.org/  <mej@kainx.org>
Linux Server/Cluster Admin, LBL.gov       Author, Eterm (www.eterm.org)
-----------------------------------------------------------------------
 "I wish you'd look at me that way, your beautiful eyes looking deep
  into mine, telling me more than any words could say.  But you don't
  even know I'm alive.  Baby, to you all I am is the invisible man."
                                                         -- 98 Degrees
Received on Fri Jan 2 02:27:15 2009
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.