Mail Archives: geda-user/2015/08/29/07:58:45
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 -