Text search problem

Questions & Answers

Moderators: fgagnon, nikos, Site Mods

Post Reply
jko
New Member
Posts: 4
Joined: 2004 Mar 04, 12:20

Text search problem

Post 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
User avatar
JRz
Gold Member
Gold Member
Posts: 560
Joined: 2003 Jun 10, 23:19
Location: NL

Post 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?
Dumb questions are the ones that are never asked :turn:
jko
New Member
Posts: 4
Joined: 2004 Mar 04, 12:20

Post by jko »

JRz,
Excellent. Thank you for your reply.

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

John
User avatar
nikos
Site Admin
Site Admin
Posts: 15771
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post 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
jko
New Member
Posts: 4
Joined: 2004 Mar 04, 12:20

Post 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
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post 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)
User avatar
JRz
Gold Member
Gold Member
Posts: 560
Joined: 2003 Jun 10, 23:19
Location: NL

Post 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?)
Dumb questions are the ones that are never asked :turn:
User avatar
nikos
Site Admin
Site Admin
Posts: 15771
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post 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!
jko
New Member
Posts: 4
Joined: 2004 Mar 04, 12:20

Post 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
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post 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:
User avatar
nikos
Site Admin
Site Admin
Posts: 15771
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

what i did was added the dollar character in the "specials" combo box, so users will be alert to the situazion
Post Reply