A lot of my files use periods/dots (".") in lieu of a space so that Linux is happy. I would like to be able to search for files where everything treated spaces and periods as equivalent but w/o having to use some fancy formula. For example, in Chrome I have a bookmark called "everything" that searches for files with the name of the highlighted text. The highlighted text often contains spaces but a file on the hard drive may contain periods instead of spaces.
Example: Highlighted text = "abc def ghi" and file on disk is "abc.def.ghi". I would like to be able to search for either one and have both show up.
Note: The Bookmark was downloaded from here and I would give credit where due but I dont remember which post it was from:
"javascript:location.href='es:'+document.getSelection();void(0);"
Best bookmark ever!
Spaces and Periods in file names
Re: Spaces and Periods in file names
Updated version of your bookmarklet:
This replaces special characters like .!#_-, etc from the selected text you you will search for "abc def ghi", which will find "abc_def.ghi" too.
See also this thread for a couple of alternatives.
Code: Select all
javascript:location.href='es:'+document.getSelection().toString().replace(/[\!\#\$\-\{\}\(\)\[\]\)\.\,\_]/g,'%20');void(0)
See also this thread for a couple of alternatives.
Re: Spaces and Periods in file names
Cool! Thanks!