delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/01/19/15:15:13

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "U-DHX98431\sthoenna" <sthoenna AT efn DOT org>
Date: Mon, 19 Jan 2004 12:13:58 -0800
To: Sam Steingold <sds AT gnu DOT org>
Cc: cygwin AT cygwin DOT com
Subject: Re: cygwin/regex is non-POSIX
Message-ID: <20040119201357.GA2608@efn.org>
References: <uhdyxm0ji DOT fsf AT gnu DOT org> <20040118050449 DOT GA3672 AT efn DOT org> <uoeszrcq9 DOT fsf AT gnu DOT org>
Mime-Version: 1.0
In-Reply-To: <uoeszrcq9.fsf@gnu.org>
User-Agent: Mutt/1.4i
Organization: bs"d
X-IsSubscribed: yes

On Mon, Jan 19, 2004 at 01:54:06PM -0500, Sam Steingold <sds AT gnu DOT org> wrote:
> > * Yitzchak Scott-Thoennes <fgubraan AT rsa DOT bet> [2004-01-17 21:04:50 -0800]:

                               ^^^^^^^^^^^^^^^^
That's cute.  But what if a real address matches a rot13'd one?

> > Also, it says backrefs part of basic regular expressions but not
> > exteneded ones.  From your mention of | I assume you are using
> > REG_EXTENDED.  If REG_EXTENDED|REG_BACKR allows backrefs, it doesn't
> > appear to be documented.
> 
> I am not sure what you mean here.  I would like to interpret your words
> as follows, so that I can agree with you:
> <http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap09.html>
> does not mention REG_BACKR, so it's mere presence can probably be
> contrued as a violation of the standard (unless it is enabled whenever
> REG_EXTENDED is).  REG_BACKR is also not mentioned in "man regex", so
> it is not documented.  Right?

I was saying xbd_chap09 (my local copy, haven't rechecked the online one for any changes, but don't expect any) says back references are only available if you *don't* say REG_EXTENDED (or at least that's my reading of it).  The regex package doc (man 3 regex, man 7 regex) also discourage using them even then.

> Now, whether I add REG_BACKR to cflags (together with REG_EXTENDED) or
> eflags, I do not get back references: "^(x)+\\1$" does not match "xx"
> (should be "xx" for whole and "x" for the group).

Then I misunderstood you.  I thought you were saying REG_BACKR allowed
backrefs even with REG_EXTENDED.  From the include file, it looks more to
me as if it is a private flag to indicate backrefs were actually found.

> Finally, a common extension appears to be the use or "?" after a
> repetition specification to mean non-greedy matching, e.g.
> "a+?" will match only the first "a" in "aaaa".

You want the pcre packages then (pcre and pcre-devel).  An important
to know non-posix feature of these is that "ab" matched against /a|ab/
will match the a where AIUI posix requires matching the ab (i.e. posix
requires longest match, but pcre lets leftmost | option take
precedence).  Not actually sure where the regex package falls WRT
this.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019