Using preprocessors inside filters with $param:

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
ydfsjkowp
Posts: 4
Joined: Tue Nov 18, 2025 5:02 am

Using preprocessors inside filters with $param:

Post by ydfsjkowp »

I'm trying to write a preprocessor / filter that would convert the following:

Code: Select all

ts:"a b_b c_(test)"
Into this:

Code: Select all

t:a t:"b b" t:"c \(test\)"
I've gotten as far as writing the following command:

Code: Select all

#[REPLACETERMS:a b_b c_(test)#,:t:#[[:[regex-replace:[regex-replace:#[[:#term:#]]:,_, ],\(|\),\\$0]#]]:#]:
For each term, do the following:
  • Replace all underscores "_" with space " "
  • Add backslashes "\" to parenthesis "()"
  • Prefix each term with the macro "t:"
And I can confirm that the command above works fine if typed directly into the search bar.

However, when I put it into a filter like this:
image.png
image.png (24.93 KiB) Viewed 1628 times

Code: Select all

#[REPLACETERMS:$param:#,:t:#[[:[regex-replace:[regex-replace:#[[:#term:#]]:,_, ],\(|\),\\$0]#]]:#]:
It just doesn't work anymore. I replaced the search term with $param:, but that doesn't seem to work. What am I doing wrong?

The search I'm using:

Code: Select all

ts:"a b_b c_(test)"
void
Developer
Posts: 19839
Joined: Fri Oct 16, 2009 11:31 pm

Re: Using preprocessors inside filters with $param:

Post by void »

Please try removing quotes from the #param:

Code: Select all

#[REPLACETERMS:#[REMOVEQUOTES:#param:#]:#,:t:#[[:[regex-replace:[regex-replace:#[[:#term:#]]:,_, ],\(|\),\\$0]#]]:#]:
ydfsjkowp
Posts: 4
Joined: Tue Nov 18, 2025 5:02 am

Re: Using preprocessors inside filters with $param:

Post by ydfsjkowp »

Yep that seems to work now, many thanks!!
Post Reply