[Wylug-help] OpenOffice Regular Expression Search and Replace
Dave Fisher
wylug-help at davefisher.co.uk
Thu May 31 15:28:25 BST 2007
On Thu, May 31, 2007 at 09:42:02AM +0100, Smylers wrote:
> > So, for example, how do people downcase a selection?
>
> It may not be possible with the Find & Replace feature. Vim, Perl,
> mod_rewrite and other substitution features which support this make
> available special symbols (not regexes) in the replacement field:
>
> * Commands such as \l and \L for affecting the case of the following
> text.
>
> * Backreferences such as \1 or $1 for referring to portions of the
> original matched text.
>
> I can't see any evidence of OO providing these things.
>
> But searching the built-in help index for "lowercase" suggests that the
> menu item Format > Change Case > Lowercase should do what you want.
>
> [*0] Actually transliteration implementations often have options for
> specifying what to do if the lists are of different lengths. But
> that's irrelevant here.
Hi Smylers,
Thanks for pointing out my errors/misunderstandings.
Sometimes one just needs a third party to put distinctive names to
things to realise that you have been bundling together of a whole family
of related things in one undifferentiated glob of (psuedo-) 'knowledge',
i.e. a set of routines that you use habitually and uncritically until
something goes wrong.
Although I'd appreciated the distinction between substitution and
transliteration (i.e. that was a 'thinko'), I don't think that I had
fully recognised that commands (like \L) and backreferences were not
actually regexes themselves ... though now that you point it out, it's
obvious why not.
That said, my reference to downcasing was really just a 'for instance'.
What I really wanted to know was:
1. Is it actually possible to do anything but trivial substitutions
using regexes in OO?
2. If so, how?
I'm guessing that, in the absence of backreferences like \1 or $1, the
answer to Q1 may be, no.
Dave
More information about the Wylug-help
mailing list