← Back to team overview

kicad-developers team mailing list archive

Re: [RFC] Wildcard and/or regex support in the component chooser

 

Here's a quick example using an open-source JavaScript library and a list
of some XMEGA parts I copied from digikey :-)
https://jsfiddle.net/o7ms290j/embedded/result/

The search items shows the whole space of things to search over.  As you
type in the box, it shows what the algorithm returns, including the
highlighting of the matched characters (in italics)

So if you just type "xmd3" you will get the answer to your example based on
this set.  Of course that might return more than just XMEGA parts based on
how big the library is, but in general these kinds of algorithms minimize
the number of keystrokes you need to get to a specific part.

Plus it handles the case of forgetting when there are variant characters
inserted in the middle of a family part number.  This can be frustrating
with "asterisk required" wildcard searches, because they won't return the
results and then you'll have to remember why and go back and insert more
wildcards.
First example that comes to mind is 7400 series logic.  Say I think "oh I
want a 74hc245, but I don't care about whatever the vendor puts at the end
of the part number"
If you type in 74hc245*, of course you will miss sn74hc245 if you put in
TI's part and forgot about it.  You have to remember the extra '*' at the
beginning
So then you put in *74hc245* and you get the TI part, but maybe you also
remembered you added a LV part also a while back, and you know what it
doesn't actually matter if you use a HC or a LV, and you want to be able to
have that show up in your search results too, so now you are at '*74*245*'

With fuzzy searching you can put in '74245' and see all of the parts in
your library that are relevant.
Fewer keystrokes (asterisks require a shift so they are higher effort too!)
and less mental overhead.

-Jon

On Fri, Dec 18, 2015 at 12:20 PM, Chris Pavlina <pavlina.chris@xxxxxxxxx>
wrote:

> No, and I'm highly skeptical it'll achieve what I'm looking for. Can you
> give an example of what you mean? How do I search for "ATXMEGA*D3" and
> get "ATXMEGA64D3", "ATXMEGA128D3", "ATXMEGA256D3", etc to come up?
>
> On Fri, Dec 18, 2015 at 12:14:33PM -0500, Jon Evans wrote:
> > More and more modern text editing software is moving to fuzzy string
> > matching rather than explicitly requiring users to put in wildcards when
> > doing searches for filenames, code intelligence searches (i.e. match
> > function / class names etc).  Have you considered that as an option?
> >
> > On Fri, Dec 18, 2015 at 12:08 PM, Chris Pavlina <pavlina.chris@xxxxxxxxx
> >
> > wrote:
> >
> > > Would everyone be okay with me patching the eeschema component chooser
> > > to support wildcards or regexes? And if yes, what's the preference -
> > > simple *? wildcards, regexes, or selectable in preferences? (Plan is to
> > > make it totally disableable [is that a word? :] in prefs anyway.)
> > >
> > > --
> > > Chris
> > >
> > > _______________________________________________
> > > Mailing list: https://launchpad.net/~kicad-developers
> > > Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> > > Unsubscribe : https://launchpad.net/~kicad-developers
> > > More help   : https://help.launchpad.net/ListHelp
> > >
>

Follow ups

References