Welcome Guest.   Make a donation to an author on the site April 18, 2014, 05:40:32 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Check out and download the GOE 2007 Freeware Challenge productivity tools.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: how do i.. with an alias?  (Read 2703 times)
lanux128
Global Moderator
*****
Posts: 6,046



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« on: April 26, 2007, 10:57:42 PM »

this should be easy for regex pros.. i have this alias here to eject removable drives and i want the semi-colon to be added automatically after the drive letter. e.g. if i type "eject e" --> "eject e:"; "eject e f" --> "eject e: f:" (minus quotes).. can someone give me a hand.. smiley

Quote
RegEx Pattern: ^eject (.*)

EjectCD $$1 | "C:\Program Files\SysTools\EJECT.EXE" $$1

another type of alias that i'm looking for is to link a path with the keyword, say "games" then whenever i type "games <abc>", Farr will be searching <abc> in the path only.. something like the "cpanel" that is available right now..
Logged

jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: April 27, 2007, 04:21:13 AM »

For the first one...
[copy or print]
RegEx Pattern: ^eject (.*):?

EjectCD $$1 | "C:\Program Files\SysTools\EJECT.EXE" $$1:
(notice the ':' after '$$1')

As for the second part, see 'Keyword Modifiers' in the advanced section of the help file. Wink
Logged

lanux128
Global Moderator
*****
Posts: 6,046



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: April 27, 2007, 05:07:24 AM »

jgpaiva, sorry it doesn't seem to work.. see the screenshots..

Defining the alias


and the result..


as for the 2nd request, thanks for pointing in the correct direction.. Thmbsup
Logged

mouser
First Author
Administrator
*****
Posts: 32,659



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: April 27, 2007, 05:34:37 AM »

actually jgpaiva's solution is basically correct -- you just need to update your alias result to SHOW YOU the : as well:

i.e. change
ejectCD $$1 | "C:\Program Files\SysTools\EJECT.EXE" $$1:

to
ejectCD $$1: | "C:\Program Files\SysTools\EJECT.EXE" $$1:


keep in mind this will not work on your example of "eject e f" since it will only add one : at the end of the f
but you could solve this by making another ejectcd alias which matches 2 drive letters and adds a : to both, but that would require a separate regular expression alias.

in this case, a better thing might be to launch a kind of batch file or script to invoke and do the replacement after the launch by this script. i urge people to use this kind of approach.

Logged
lanux128
Global Moderator
*****
Posts: 6,046



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: April 27, 2007, 05:54:41 AM »

keep in mind this will not work on your example of "eject e f" since it will only add one : at the end of the f
but you could solve this by making another ejectcd alias which matches 2 drive letters and adds a : to both, but that would require a separate regular expression alias.

thanks for the explanation, mouser.. so, how do i go about the alias that matches two drive letters?
Logged

jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: April 27, 2007, 06:12:28 AM »

This one should work.. Wink
[copy or print]
RegEx Pattern: ^eject (.):? (.):?

EjectCD $$1: $$2: | "C:\Program Files\SysTools\EJECT.EXE" $$1: $$2:
(the ':?' is just so that you can still optionally put the ':' there)

[edit] corrected error with the pattern [/edit]
« Last Edit: April 27, 2007, 06:15:23 AM by jgpaiva » Logged

lanux128
Global Moderator
*****
Posts: 6,046



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #6 on: April 27, 2007, 06:22:55 AM »

thanks a lot, jgpaiva! smiley now i can really work better with my removable drives Thmbsup
Logged

Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.035s | Server load: 0.05 ]