DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Possible to lower/upper case Regex Alias Filter Pattern matches?  (Read 6,043 times)

Merlin2001

  • Supporting Member
  • Joined in 2014
  • **
  • Posts: 3
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,175
    • Coding Snacks
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
Re: Possible to lower/upper case Regex Alias Filter Pattern matches?
« Reply #1 on: October 25, 2018, 06: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)
#NoEnv
#SingleInstance force
;Search Google for input parameter string
if A_Args[1]
  Run % "https://www.google.com/search?q=" Format("{:L}", A_Args[1])

Merlin2001

  • Supporting Member
  • Joined in 2014
  • **
  • Posts: 3
Re: Possible to lower/upper case Regex Alias Filter Pattern matches?
« Reply #2 on: November 27, 2018, 06: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

Original address: https://www.donationcoder.com/forum/index.php?topic=46577.0