Title

Message

Confirm

Want to earn a free FileSeek Pro license? We're looking for FileSeek translators!
<< DiscussionsReply

exact match problem

Avatar from Gravatar.com
Ekrem Eko17433
1 discussion post
Hi,
When I try exact match for query "free", the results contain also "freeware" which is not what I want.

My query is =free

Do you help me about this?
Aug 10, 2019  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Looks like the exact match might be somewhat broken, I've put this on our list to investigate for the next version.

In the meantime, if you set the mode to RegEx, you can do this to get the results you're looking for:

\bfree\b


The \b means word boundary, so it will only match the word "free" if it's on its own.
Aug 12, 2019  • #2
Avatar from Gravatar.com
technotron
3 discussion posts
I took at look at this, and the Equality Modifier doesn't work the way it's supposed to. At a quick glance, using the "equality modifier" in a text query combined with "match query to each line in file" seem to be the regex equivalant of '^' and '$'.
Supposedly, you can search ="cats and dogs" and it'll match cats and dogs exactly.
I decided to post my findings here in case it would help you narrow down the issue.

I made a file called "test 01.txt", which contains:

Code



I had several test cases. Case 1 seems to be bugged.

Case 1: text query + match query to entire file
="cats and dogs"
This query wasn't able to find any text at all in "test 01.txt", surprisingly. This result seems to indicate the equality modifier isn't working properly with these particular settings. The only way I got the equality modifier to work is to use text query with "match query to each line in file"

Case 2: text query + match query to each line in file
="cats and dogs"
Whenever I use "match query to each line in file", fileseek seems to go through each line to see if there's an exact match on that line. It matches just a single line: the line that exactly matches cats and dogs . (line 2 in the text file.)
Text query + match query to each line in file will only match lines that have exactly cats and dogs on the line. If there is other text on that particular line, the query won't match cats and dogs. I don't know if this behavior is correct, but I'll assume that's how it's supposed to work.

Case 3: regex query + match query to entire file
\bcats and dogs\b
This query matches every line since all of them contain cats and dogs. This result is expected behavior.

There are 2 ways (that I know of) to do string matching: string matching per string, or string matching per line.
Case 2 seems to be similar to the regex equivalent of '^' and '$'. Case 2 searches the entire line for a match. '^' and '$' matches according to the entire line. ^cats and dogs$ would match lines that match exactly cats and dogs, but nothing more.
Case 3 is the regex equivalent of '\b'. Case 3 searches the string you enter for zero-width "word" boundaries. '\b' matches according to words on the line. \bcats and dogs\b would match words cats and dogs on a line that like start cats and dogs (line 1 in the text file)
Aug 18, 2019 (modified Aug 18, 2019)  • #3
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Case 2 is actually how it works right now. The = operator uses string.Equals, and since FileSeek feeds the whole line as the string, it's trying to match the Query text to the entire line. We're planning to change the = operator to use the RegEx word boundary instead :)

Thanks!
Aug 21, 2019  • #4
Was this helpful?  Login to Vote  Login to Vote
<< DiscussionsReply