[josm-dev] Search and | ?

Karl Newman siliconfiend at gmail.com
Mon Dec 22 16:53:03 GMT 2008


On Mon, Dec 22, 2008 at 8:29 AM, Ævar Arnfjörð Bjarmason
<avarab at gmail.com>wrote:

> On Mon, Dec 22, 2008 at 4:39 AM, Russ Nelson <nelson at crynwr.com> wrote:
> > Ævar Arnfjörð Bjarmason writes:
> >  > * http://josm.openstreetmap.de/ticket/1864 - Search doesn't support
> >  > regex search on keys and/or values
> >
> > The problem is always the user interface.  I can think of several ways
> > to implement regexps:
> >
> > 1) just implement them.  Instead of doing a liberal substring
> > search, do a regexp search, always treating their input as a regexp.
> > That has the unhappy effect of forcing regexp character
> > interpretation, which may give them results which differ from the
> > previous behavior (but for the most part would give them the same
> > results).
> >
> > 2) keep the current substring search for unqualified string searches,
> > but use regexps if they supply a colon (to search in K:V) or user: .
> > That has the unhappy effect of not being obvious.
> >
> > 3) use a prefix character to indicate a regexp search, e.g. all
> > regexps must start with ^.  Not likely that any literal searches would
> > start with ^.
>
> If this was done it would probably be better to use ~, ^ already has
> special meaning so you'd have to do "^^foo:^^bar" to look for a
> key/value that started with foo:bar as opposed to "~foo:~bar"
>
> > 4) Add it as an option in the Search box:   [] use regular expressions
>
> This is probably the most sane way to do it. But each part of the
> regex as separated by : needs to be considered as its own regex, i.e.:
>
>  regex1:regex2
>
> or:
>
>  "^regex.*containing[^colon:]":^[^a]*$
>
>
Why not just have two separate text fields, one for key, one for value, and
optional regex search for each?

Karl



More information about the josm-dev mailing list