Thanks @kingkeith. I stand corrected. I had forgotten one could set individual values in the args
of the show_panel
command.
To answer the original question then (hopefully), here is a possible solution with a keybinding that does it (with full credits to @kingkeith)
{
"keys": ["ctrl+h"],
"command": "show_panel",
"args": {
"panel": "replace",
"reverse": false,
"regex": true
},
},
Place this keybinding in any of your User keybinding files (This overrides the default ctrl + h that opens the replace
panel or you can have any key binding you want). This will make sure that the regex
button is always turned on when the replace panel is opened even if you turn it off in a previous usage & close the panel. The state of the other buttons should stay the same as the last usage.
(This will only work if you press only ctrl + h (or your defined binding) & not if you select it from Find -> Replace
from main menu as that is tied to the original show_panel
command without the regex
flag to true
)