topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday December 13, 2024, 5:26 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: request: dosearch_noregex (dosearch but ignore regex in other aliases)  (Read 4914 times)

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Background
Imagine a user has these two aliases and one search directory item in FARR.

Alias1 (example of regex to get a single static result)
text: a
regex: ^a$
result: C:\folder\app.exe

Alias2 (example of regular expression aliases as search templates)
text: cdir
regex: ^(?:c|cd|cdi|cdir) (.+)$
result: dosearch +cdir $$1

Search Directory item
directory path: C:\cdir
optional modifier keywords: cdir

Problem case
The user types "c a" and want as result the list of files/folder in C:\cdir that contain "a".
But instead the result is "C:\folder\app.exe" . Because Alias1 is triggered by the new "a" search and since it is a regex alias it gets priority.

Collisions like that increase the more aliases of these two sorts one has. A pity since both sorts of aliases are useful.

Request for solution
Add a new virtual launch string named dosearch_noregex to FARR.
dosearch_noregex would start a new search but ignore all alias regex matches.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Agreed, it would be useful to be able to bypass alias matches...

What about adding support for "-noalias" keyword in search -- if found it would bypass trying to match any aliases (regex or otherwise).  Would that also solve your case? (you would do a dosearch -noalias)?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Oops I just realized this already exists.. You can use -alias to not match aliases, or +alias to only match aliases.

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,544
  • @Slartibartfarst
    • View Profile
    • Read more about this member.
    • Donate to Member
Oops I just realized this already exists..
...
Your alter-ego seems to have been smarter than you are...
 :D   :D    :D

You tend to build some incredibly useful (if not brilliant) functionality into your software, and then seem to forget about it.
But is it documented?    ;)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
You tend to build some incredibly useful (if not brilliant) functionality into your software, and then seem to forget about it.
But is it documented?

I do tend to forget features I add, it's true.
Thankfully yes, it is documented.  That's the key isn't it -- to document these things as they are added.

From the help page on "Special Search Modifier Keywords":

+sall
show all matching results, bypassing the normal limit on result count

+alias
match search only against aliases

-alias
do not show any matching aliases (only files)


-history
do not give bonus scores to items in history

-.
do not show any files, only folders (and aliases)

-\
do not show any matching folders, only files (and aliases)

+\
show matching folders

+launchone
as soon as there is one (alias) result in the result list, launch it.

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,544
  • @Slartibartfarst
    • View Profile
    • Read more about this member.
    • Donate to Member
Ahh. Thanks. Very thorough, as usual.

I have a similar problem (forgetting details of stuff I have done), so years ago I developed the habit of documenting everything. I used to use a system I developed and which worked well in a hardcopy notebook form, but now I tend to increasingly use things like OneNote, Stick-A-Note, and Readme.txt files to make notes.

I have not yet quite been able to replicate my notebook system on a PC, though I came close years ago - surpassed it, in fact - with Lotus Agenda (a PIM).
« Last Edit: February 11, 2018, 11:16 AM by IainB »

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Oops I just realized this already exists.. You can use -alias to not match aliases, or +alias to only match aliases.
Great! I must've only looked at the "Special/Virtual Launch Strings/Commands" page in help so missed that feature. Thank you for making it long before I requested it.  ;D