It would be very handy to set a shortcut to script in Kile that replaces given instances of text, like for setting non-breaking spaces (~) around given words within selected text:
This regexp puts ~ after given words.
I've read through "Scripting" section of the Kile Handbook and there doesn't seem to be any reference to regexps for finding text, and provided examples seem way too tedious for even such simple things as replacing tag contents.
There are, some
document.startsWith and similar
document.endsWith functions, which require pattern argument, however those seems to apply to whole lines only and the format of pattern argument is unspecified.
Perhaps there's a way to call Edit->Replace command (with needed parameters [like Mode: Regular expression; Selection only]) programmatically (i.e. with
How do I reproduce regexp behaviour (like the one above) as a Kile script?