pragha icon indicating copy to clipboard operation
pragha copied to clipboard

Searching with spaces does not work

Open dumblob opened this issue 12 years ago • 1 comments

When searching the playlist for some string containing space, it doesn't find any match. I've tested this on both GTK2 and GTK3 versions.

My idea for searching in the following playlist:

  1. Abc Xyz
  2. Jkl xyz Mno
  3. Pqr Stuvw Xyz

yields: if the search term is "abc", it matches only the first item if the search term is "abc xyz", it matches only the first item if the search term is "abc xyz" (notice the double-space in between), it matches only the first item if the search term is " abc xyz " (notice the redundant spaces at the beginning and at the end), it matches only the first item if the search term is " abc xyz " (many spaces on many places :-)), it also matches te first item if the search term is " Xyz ", it matches the first and last item, but not the second one (but " xyz " would match all 3 items)

Simply said, handle any number of consecutive white characters in between of words/tokens as regexp [:space:]+ and in case of consecutive white characters at the beginning or at the end of search term, use the regexp [:space:]* for finding matches in the playlist. This is really usefull when the tag contains e.g. tabulator instead of space; or two spaces instead of one etc. And be case insensitive when the search term doesn't contain any upper case characters and be case sensitive if the search term contains at least one upper case character.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

dumblob avatar Nov 27 '12 09:11 dumblob

Hi dumblob, Sorry for the delay, and thanks for every suggestion. ;)

Well.. All we ask, is relatively simple. But I worry that the search now is already sufficiently slowly.. :s

I want to do it, but first we try to optimize the code we have..

Regards.

matiasdelellis avatar Dec 03 '12 14:12 matiasdelellis