ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Find And Run Robot

possible regex search alias bug

<< < (2/3) > >>

Nod5:
Aha! The problem is a space in the dosearch command string. If I change

--- ---aa | dosearch C:\test\ $$1
into

--- ---aa | dosearch C:\test\$$1
the problem is solved.

mouser:
I'm still a bit confused but it sounds like you are saying that what happened was the proper alias was triggered and then as it's action it replaced the search with text that immediately matched the other alias.

skajfes:
The problem is with the aa alias.
You are capturing the space with the search string.
So when you type in
--- ---aa[space] FARR captures the space as $$1. Then in turn, you pass $$1 along to the result and have
--- ---dosearch C:\test\[space][space] that triggers the other alias that matches on \s\s.

I think it is good practice not to capture the space before the parameters. There is less chance of bugs like this.

Nod5:
mouser & skajfes: you are right, thank you for the explanation.  :Thmbsup:

skajfes: good practice in general - agreed! But in this particular case I wanted the alias to trigger first on "aa" (show all files in a folder) and on "aa somephrase" (show files in the folder matching "somephrase") *and* not switch back to a regular FARR search inbetween that. For that I needed the first space included in the match pattern.

skajfes:
If I understand you correctly you can write a regex like this with same effect:

--- ---^aa\s?(.*)$

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version