Your hint worked - but what if I want to access the non-captured groups in the "Result Filter for RegEx"?
Example:
What I want:
a) Typing
wiki should result in the following aliases being shown: Wikipedia (Deutsch), Wikipedia (English), Wi
ktionary (Deutsch), Wi
ktionary (English), Wikiquote (Deutsch), Wikiquote (English), ..., Wikimedia
a²) Typing
wikt should show only the Wiktionary entries.
b) These aliases should be
directly accessible when typing
wiki (no space after it), which means that every entry can be activated without having to enter a group (which would require pressing enter twice in total)
c) If no argument is manually entered ([space]+words), the last selected or copied text should be used
d) Adding more characters, e.g. a
p should narrow the displayed aliases (e.g. to the two Wikipedia entries)
e) The original order of the entries should be preserved
Examples: In the following "foobar" is in the clipboard. _ is used to display the space character at the end of inputs.
1)
wikipediaX,
wikipX show normal file/alias search for wikipediaX, wikipX
2)
wiki,
wiki_ show all wiki-related aliases with
foobar as argument
3)
wiki baz shows all wiki-related aliases with
baz as argument
4)
wikip,
wikipe, ...,
wikipedia,
wikip_,
wikipe_, ...,
wikipedia_ show both Wikipedia entries with
foobar as argument
5)
wikip baz,
wikipe baz, ...,
wikipedia baz show both Wikipedia entries with
baz as argument
6)
wikt,
wikti, ...,
wiktionary,
wikt_,
wikti_, ...,
wiktionary_ show both Wiktionary entries with
foobar as argument
7)
wikt baz,
wikti baz, ...,
wiktionary baz show both Wiktionary entries with
baz as argument
The alias lines currently look like this:
Wikipedia (English) - $$c | htmlviewurl http://en.wikipedia....l:Search&search=$$c /ICON=icons\wikipedia.icoWhat I tried:
1. One big alias group called
wiki1.1 With regular expression
^wiki (.*) -> a), b), c) OK but d) does not work.
1.2 With regular expression
^(?:wiki|wikipedia|wiktionary|wikiquote|wikibooks|wikiversity|wikinews|wikimedia) (.*) -> a), b), c) OK but d) does not work completely. Typing wikiquote does show results but it shows all results. Not using (?:...) would result in $$1 being used which would make $$c unusable, therefore c) unfulfilled.
2. Many small alias groups "wikipedia", "wiktionary", "wikiquote", "wikibooks", "wikiversity", "wikinews", "wikimedia". With regular expression
^(?:wiki|wikipedia) (.*),
^(?:wiki|wiktionary) (.*) etc. -> Typing wiki hides the wiktionary alias group -> unacceptable
3. Many small alias groups, all called "wiki"
3.1 Using regular expressions like
^wiki(?:pedia|pedi|ped|pe|p)? (.*),
^wik(?:i|t(?:ionary|ionar|iona|ion|io|i)?) (.*) -> a), b), c) OK but d) does not work
3.2 Using regular expressions like
^wiki(?:pedia|pedi|ped|pe|p)?\ ?(.*),
^wik(?:i|t(?:ionary|ionar|iona|ion|io|i)?)\ ?(.*) -> a), b) OK, c), d) almost OK since entering wikiped shows the wikipedia alias with copied text (good)
and the wiktionary alias with "ped" as argument.
Do you have any ideas how to realize what I want?
Using "Result Filter for RegEx" hurts requirement e) - I want the results only to be filtered - not sorted.
I think the easiest (and also the most general) solution would be
1. An option (perhaps inline) that the Result Filter does not changes the alias order
2. A function like this:
ifempty(variable1, variable2)=variable1 if variable1 is not empty, variable2 otherwise
With this I could simply use a big alias group with the regular expression
^(wik(?:i|t)[^\ ]*)\ ?(.*) and entries using
ifempty($$2,$c).