topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Tuesday April 16, 2024, 12:18 am
  • 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: Possible to lower/upper case Regex Alias Filter Pattern matches?  (Read 3787 times)

Merlin2001

  • Supporting Member
  • Joined in 2014
  • **
  • Posts: 3
    • View Profile
    • Donate to Member
Hi @all,

I'm a long time devoted FARR user and started to use aliases more heavily recently.
Now I have a problem I couldn't solve by myself (using the help, the forum and trial and error) and hope somebody can point me in the right direction :D

I have setup an alias that calls a URL in my browser if prefixed with '@'.
So searching @test will open the browser with https://foobar.com/test.
This works like a charm!

The problem now is, that the URL is case sensitive while I want the query to be case insensitive.
So searching @TesT should also open https://foobar.com/test because https://foobar.com/TesT will give me a 404.
Unfortunately, I have no power to fix this on the target side :(

Is there any way to convert the $$u1 placeholder in my URL to lower case?

Thanks in advance for all your thoughts!
Marcus

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Possible to lower/upper case Regex Alias Filter Pattern matches?
« Reply #1 on: October 25, 2018, 01:45 PM »
I don't think there is a built in method in FARR to do that, though I might be wrong.

Here is a workaround where you pass the search string to AutoHotkey which makes it lowercase and runs the search. You can change the alias name, folder path, base URL and so on to fit your use case.

First create the alias
- alias name: _
- RegEx: _(.+)
- Result(s): C:\folder\search_lowercase.exe "$$1"

Next save this code as search_lowercase.ahk, compile it and move to C:\folder\search_lowercase.exe
Code: Autohotkey [Select]
  1. ;Search Google for input parameter string
  2. if A_Args[1]
  3.   Run % "https://www.google.com/search?q=" Format("{:L}", A_Args[1])

Merlin2001

  • Supporting Member
  • Joined in 2014
  • **
  • Posts: 3
    • View Profile
    • Donate to Member
Re: Possible to lower/upper case Regex Alias Filter Pattern matches?
« Reply #2 on: November 27, 2018, 12:18 PM »
Hi Nod5,

sorry for my late reply and thank you very much for your suggestion!
I didn't think about pre-processing with an AutoHotkey script and may go down that route :D

Have a great week!
Marcus