www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2015/08/29/07:58:45

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
Date: Sat, 29 Aug 2015 14:00:25 +0200 (CEST)
X-X-Sender: igor2 AT igor2priv
To: "Stephen R. van den Berg (srb AT cuci DOT nl) [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: <20150828170119.GA10344@cuci.nl>
Message-ID: <alpine.DEB.2.00.1508291347390.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> <alpine DOT DEB DOT 2 DOT 00 DOT 1508281755010 DOT 6924 AT igor2priv> <201508281615 DOT t7SGFeQP014919 AT envy DOT delorie DOT com>
<alpine DOT DEB DOT 2 DOT 00 DOT 1508281826040 DOT 6924 AT igor2priv> <20150828170119 DOT GA10344 AT cuci DOT nl>
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, Stephen R. van den Berg (srb AT cuci DOT nl) [via geda-user AT delorie DOT com] wrote:

> gedau AT igor2 DOT repo DOT hu wrote:
>
> For people which are not well versed in regexes, the current behaviour
> (anchored regex) is simpler to understand.
> So if you want to use it unanchored, it should be a configoption; then
> again, you might as well type .* before and/or after it when you need that
> type of behaviour.

I partially agree: less experienced users may want to avoid regex. 
However, with the original implementation they can not: a search for 
R1.3|R1.4 will not find R1.3 and R1.4 but a lot more. What I believe a 
non-regex user really expects is that only character '|' should have 
special meaning.

I believe the original solution fails to serve the casual users by 
surprising them with regex interpretation while it also may cause 
experienced users a headache figuring the forced anchoring.

To overcome this problem I've changed the search dialog in pcb-rnd from a 
single-string prompt to a attribute dialog with 2 fields: a pattern 
(string) and a method (enum). Method is either regex or string list.

Regex interprets the pattern as true regex without anchoring. String list 
splits the pattern at '|', strips whitepsace from words and uses 
strcasecmp() against each word.

As a bonus, with an attribute dialog it was trivial to make the dialog 
remember the last string entered and the last method selected.

Regards,

Igor2

- Raw text -


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