feature request - Regular Expressions

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Post by *djk »

Author used this form ("already works") meaning probably that he implemented it already in... his testing version :-)
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl
User avatar
marekjed
Junior Member
Junior Member
Posts: 25
Joined: 2003-10-16, 18:09 UTC

How about boolean instead?

Post by *marekjed »

Given the problems with applying regular expressions to partially loaded files, how about a boolean AND/OR/NOT search instead? The regexp problem goes away, and although regexps are very cool , in practice I find boolean searches more useful when it comes to finding stuff in files. Especially if there's also a NEAR keyword, with a user-adjustable proximity setting.
No ads, no nags freeware: http://www.tranglos.com
(KeyNote, PhoneDeck, KookieJar, Oubliette)
User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post by *JohnFredC »

2marekjed

I just went to the Keynote forum and downloaded KeyNote... WOW! What a wonderful tool and a great development model for it, too.

Goodbye Treepad, Hello Keynote!


Welcome to the TC forum! Looking forward to your contributions.
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
PoV
Junior Member
Junior Member
Posts: 9
Joined: 2003-10-16, 12:35 UTC
Location: Paris, France

Post by *PoV »

shammat wrote:
ghisler(Author) wrote:The problem is that the RegEx library needs the text to be searched to be in memory. [...] Any ideas?
How does grep solve this problem?
I'm not sure, but I don't think that command line tools like grep load the whole file into memory. So there should be a solution. There is a gnu version of grep around so you could have a look at the source code....
There is indeed a GNU version of grep, but if my memory's right, it tries to match the pattern on a per-line basis, that is, it reads a line, try to see if there is a match, then the next line, and so on...
I guess that could be a way of doing it, and to avoid binary files, looking if the file contains any char < 32 may be a way. Or throwing an error if after 64K read no \r\n|\r|\n was found, like "File seems to be binary data, I may have to read the entire file in memory, are you sure this is what you want ?". This amount could even be configurable.
Post Reply