I was wondering how feasible it would be to intercept the "enter down" event in the URL bar, copy the text to the clipboard, check to see if it matches the pattern, then expand the URL and paste it back in and press enter.
In particular, does anyone have an idea of how to detect when "enter down" happens within the search/url box, rather than in forms and the like within a webpage?
How about macro activated by a hotkey in your browser that displays a Prompt for User Input field for your search string, which you would enter just like Omnikey? Subsequent actions would expand the search string to go to a new tab in your browser with the expanded search URL.
Assuming that you set the KM Variable "Local__SearchStr" to the first Capture Group, then use the KM Open a URL action, with this as the parameter for that Action: https://en.wikipedia.org/wiki/Special:Search/%Local__SearchStr%
Of course, you can use whatever URL search root you wish.
FWIW, I use this format of ";" as the prefix and "𝍖" as the suffix to trigger all of my typed string macros, and text expansion snippets with Typinator. This works very well to ensure no false positives.