Page 1 of 1

Text search problem

Posted: 2004 Mar 04, 12:25
by jko
I have a problem with 2.5.0.5

A text file I have has the following in it:

$cat_list

If I do search on $ it is ok, $c is also ok, but a search on $ca or longer does not find anything.

I have tried both the standard and unicode versions.

Any suggestions?

John

Posted: 2004 Mar 04, 12:50
by JRz
$ has a special meaning (see under 'Special characters' in the find dialog)

To prevent Editor2 from interpreting a $-sign as special character in combination with the two following characters, just type it twice in the search field

try: $$ca

and you will find your text

@Nikos, leaves the fact that $ca is undocumented as special character? I presume it is interpreted as a special char (just as $0D is), but this yields undesirable results (what does $ca mean??). Can you limit the use of $ prefixing to the known set of special characters? If the chars after the $-sign don't match to form any of the known special ones, just process it as a $ sign?

Posted: 2004 Mar 04, 13:23
by jko
JRz,
Excellent. Thank you for your reply.

That explains why it works for some strings prefixed by $ and not others.

John

Posted: 2004 Mar 04, 13:57
by nikos
$xx is a special code that matches a single hex character with code xx. In that sense $ca is replaced with the character with numeric value 202, whatever it may be

Posted: 2004 Mar 04, 14:30
by jko
I see.
So $0-9,A-F plus 1 other 0-9,A-F character is interpreted as hex.

I hate to be a pain, but would it be possible to default to $ being $ unless the user "enables" a "special character" search tick box?

Just a thought.

John

Posted: 2004 Mar 04, 15:38
by fgagnon
That's a good idea, jko ... I agree. :)

Nikos, I know that you want Editor² to be able to find any character/byte by its hex-code in a file, but IMO that should be an option, not the default.
Even though the $$ workaround is described in Help | Information, the app is so otherwise-intuitive to use, most folks (JRz excepted) never think to look there.
So, how about adding a 5th tick-box to the "find text" options list?
viz: [_] $xx finds character/byte(hex)

Posted: 2004 Mar 04, 16:26
by JRz
Not a bad idea. Many other programs give you the option to do a 'normal' search (characters as is) or a search using advanced techniques, such as regular expressions (maybe you will implement those too is the far future Nikos?)

Posted: 2004 Mar 04, 18:55
by nikos
what are the chances of people searching for something that begins with $ and is followed by exactly 2 hex digits?

Keep in mind that the same story holds for x2's "grep" and find text commands, so watch those dollarz!

Posted: 2004 Mar 04, 19:07
by jko
It doesn't have to be just 2 hex digits. Or rather it does, but the string can be any length. So long as the 2 characters following the $ are valid hex numbers the string is not found.

I appreciate what you say, but, in the code files I'm looking at, it appears a surprising number of times.

John

Posted: 2004 Mar 04, 21:40
by fgagnon
The $nn combo also occurs regularly in price lists on this side of the pond, Nikos.
But it really is not so much about "what are the chances... ?" as it is about consistency. So it should be addressed for the x² usages, too! :twisted:

Posted: 2004 Mar 05, 08:59
by nikos
what i did was added the dollar character in the "specials" combo box, so users will be alert to the situazion