www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2015/08/28/11:59:38

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
Date: Fri, 28 Aug 2015 18:01:09 +0200 (CEST)
X-X-Sender: igor2 AT igor2priv
To: "Matt Rhys-Roberts (matt DOT rhys-roberts AT envinsci DOT co DOT uk) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
X-Debug: to=geda-user AT delorie DOT com from="gedau AT igor2 DOT repo DOT hu"
From: gedau AT igor2 DOT repo DOT hu
Subject: Re: [geda-user] when pcb disperse command loses elements
In-Reply-To: <alpine.DEB.2.00.1508281520400.6924@igor2priv>
Message-ID: <alpine.DEB.2.00.1508281755010.6924@igor2priv>
References: <55E02536 DOT 8020202 AT envinsci DOT co DOT uk> <alpine DOT DEB DOT 2 DOT 00 DOT 1508281126210 DOT 6924 AT igor2priv> <55E05A27 DOT 6090204 AT envinsci DOT co DOT uk> <alpine DOT DEB DOT 2 DOT 00 DOT 1508281520400 DOT 6924 AT igor2priv>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
MIME-Version: 1.0
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com


On Fri, 28 Aug 2015, gedau AT igor2 DOT repo DOT hu wrote:

> Tested it now, it seems it's not pure regex but does some 
> transformation/magic, probably assuming the format will be letter-number or 
> forcing match from the beginning of the refdes, I'm not sure.
>

Meanwhile I took a look at the code. It seems regexec_match_all() does the 
regex match and then checks whether the match fully covers the string.

This is the same as if it wrapped any search x in ^x$. So in mainline PCB 
your regex needs to match each character of the name; if you don't want ^ 
or $, you need to use .* at the beginning or at the end.

I support the Rule of Least Surprise, and this is not how regex usually 
works. Thus I changed this in pcb-rnd: it now has pure regex support, 
without further checks, it doesn't invent or force ^ or $. I also 
modified the query dialog so that it mentions the pattern you input is 
regex.

Regards,

Igor2

- Raw text -


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