[BUG] Searching the Dictionary with $

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[BUG] Searching the Dictionary with $

Kay C Lan
Devin posted about $_POST_RAW so I decided to have a look at it in the
LC 9.0.0 dp4 Dictionary where I discovered that $ must be a special
character (I'm guessing REGEX end of line) as I needed to escape it
with \$ to get the results I wanted.

In LC 6.6.5 there is no need to escape the $ character

I've entered it as BUG #19031

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [BUG] Searching the Dictionary with $

Mike Kerner
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 (try to expand the window and see what
happens).  Other than the tab control, the rest is one big browser widget,
so the behavior will be less LC and more webby.  I've been threatening to
rework it, but I've been busy with other projects, and now it looks like
I'm about to get busier, so it might be a while if I'm the one working on
it.  The good news is that most of the back end is implemented via a DB, so
the main problem will be with (some of) the rendering.  I am willing to bet
that a hybrid browser widget and various other LC objects will be the
fastest way to get it fixed.

On Wed, Dec 21, 2016 at 7:11 PM, Kay C Lan <[hidden email]> wrote:

> Devin posted about $_POST_RAW so I decided to have a look at it in the
> LC 9.0.0 dp4 Dictionary where I discovered that $ must be a special
> character (I'm guessing REGEX end of line) as I needed to escape it
> with \$ to get the results I wanted.
>
> In LC 6.6.5 there is no need to escape the $ character
>
> I've entered it as BUG #19031
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> 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
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [BUG] Searching the Dictionary with $

Kay C Lan
On Thu, Dec 22, 2016 at 10:45 PM, Mike Kerner <[hidden email]> 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
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [BUG] Searching the Dictionary with $

Mike Kerner
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 <[hidden email]> wrote:

> On Thu, Dec 22, 2016 at 10:45 PM, Mike Kerner <[hidden email]>
> 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
> [hidden email]
> 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
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [BUG] Searching the Dictionary with $

Ali Lloyd-2
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 <[hidden email]>
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 <[hidden email]>
> wrote:
>
> > On Thu, Dec 22, 2016 at 10:45 PM, Mike Kerner <[hidden email]
> >
> > 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
> > [hidden email]
> > 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
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [BUG] Searching the Dictionary with $

Mike Kerner
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 <[hidden email]> 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 <[hidden email]>
> 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 <[hidden email]>
> > wrote:
> >
> > > On Thu, Dec 22, 2016 at 10:45 PM, Mike Kerner <
> [hidden email]
> > >
> > > 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
> > > [hidden email]
> > > 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
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> 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
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [BUG] Searching the Dictionary with $

Kay C Lan
In reply to this post by Ali Lloyd-2
On Sat, Dec 24, 2016 at 1:27 AM, Ali Lloyd <[hidden email]> wrote:
>
> 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.
>
Hope everyone has had a wonderful Christmas.

Yes, I think like the expanded options within the Script Editors Find
dialogue box that allows the possibility to choose 'Regular
expression', 'Wildcard' or 'Plain text' would be handy and clearly
delineate when characters do or do not need to be escaped.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [BUG] Searching the Dictionary with $

Mike Kerner
or when someone hangs extra characters on the end of a word for no reason,
like "dialogue"

On Wed, Dec 28, 2016 at 5:44 PM, Kay C Lan <[hidden email]> wrote:

> On Sat, Dec 24, 2016 at 1:27 AM, Ali Lloyd <[hidden email]> wrote:
> >
> > 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.
> >
> Hope everyone has had a wonderful Christmas.
>
> Yes, I think like the expanded options within the Script Editors Find
> dialogue box that allows the possibility to choose 'Regular
> expression', 'Wildcard' or 'Plain text' would be handy and clearly
> delineate when characters do or do not need to be escaped.
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> 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
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode