[BUG] Searching the Dictionary with $

Mike Kerner MikeKerner at roadrunner.com
Fri Dec 23 12:50:03 EST 2016


For those of us who don't speak regex, I'm glad it's easier than it looked.

On Fri, Dec 23, 2016 at 12:27 PM, Ali Lloyd <ali.lloyd at livecode.com> wrote:

> It's not hard to fix. One way would be to add a function
>
> function escapeRegExp(str) {
>   return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
> }
>
> to dictionary_functions.js
>
> and add the line
>
> pTerm = escapeRegExp(pTerm);
>
> to the dataSearch function here:
> https://github.com/livecode/livecode-ide/blob/develop/
> Documentation/html_viewer/js/dictionary_functions.js#L44
>
> At some point we might want to add the option to regex-search the
> dictionary so it's probably worth keeping the regex implementation
> internally.
>
> On Fri, Dec 23, 2016 at 4:31 PM Mike Kerner <MikeKerner at roadrunner.com>
> wrote:
>
> > did you try quoting the string instead of escaping it?  I don't think
> this
> > is going to be trivial to fix without having at it, but I also haven't
> read
> > through the code in a month-plus.
> >
> > On Thu, Dec 22, 2016 at 6:51 PM, Kay C Lan <lan.kc.macmail at gmail.com>
> > wrote:
> >
> > > On Thu, Dec 22, 2016 at 10:45 PM, Mike Kerner <
> MikeKerner at roadrunner.com
> > >
> > > wrote:
> > > > The new dictionary is indeed different.  It is (mostly) implemented
> > using
> > > > the Bootstrap framework, which also means that much of it is more
> > > > webby than the rest of us might like
> > >
> > > Some of what we like and don't like can be simply down to our aversion
> > > to change. With the Dictionary I think the new version is 'generally'
> > > headed in the right direction. Whether it is easier or harder to fix
> > > now that it's more webby I can't comment; all I know is that Panos has
> > > confirmed it's a regression problem so the team is onto it :-)
> > >
> > > There is no excuse to not being able to find a Dictionary entry by
> > > using the 'exact' characters.
> > >
> > > _______________________________________________
> > > use-livecode mailing list
> > > use-livecode at lists.runrev.com
> > > Please visit this url to subscribe, unsubscribe and manage your
> > > subscription preferences:
> > > http://lists.runrev.com/mailman/listinfo/use-livecode
> > >
> >
> >
> >
> > --
> > On the first day, God created the heavens and the Earth
> > On the second day, God created the oceans.
> > On the third day, God put the animals on hold for a few hours,
> >    and did a little diving.
> > And God said, "This is good."
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."



More information about the Use-livecode mailing list