On 02/18/2015 08:29 PM, James wrote:
I probably should have added my question here instead of the
developers list:
This is related to the question at the end of this thread post
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg186437.html
Where can I find out about the syntax for writing my own user defined
regular expressions?
It is quite a powerful feature, but is utterly useless for a
non-developer if there is no way to learn the syntax required to
create an expression. There are plenty of things I would like be able
to find and replace in the LyX environment, but dont know how... The
alternative (which I'm guessing most people use) is to export as a TeX
file and then find and replace in a text editor. But surely there is a
better way.
What language does it use?
I've seen something about Perl somewhere.
We use some standard C++ regex engine, either from boost or tr1 or MSVC.
These provide basic regular expressions, including back references, I
believe.
Two specific cases of find and replace expressions:
1) Double words can be found easily as in the thread linked above.
What would I need to put in the "Replace with:" section to delete a
duplicate word once found?
Can it be done?
I'm not sure if this is possible. You would have to use backreferences,
which you can do in Perl, etc, but I don't know if we support that.
2) I would like to find all \bigskip{} and replace with \medskip{}.
How do I create a user defined regular expression to do this? Can I
even search for TeX expressions?
I believe you can search for the Bigskip inset and replace it with a
Medskip inset, so no regexes needed.
Richard