On 11/04/2008 18:14, Régis POTELLE wrote:
Dear Sir, Madam,
Openoffice is for me an essential tool . I'm using it every day within the
context of my work, especially the macro-programming . Hats off to you for
this software !
My question is the one after:
Is it possible to use boolean expressions like AND or OR in regular
expressions ? And if so, how shall I do it ?
The "or" is represented by a vertical bar. So "a|b" means "a or b" and
"(ab)|(cde)|(xy*)" means "ab or cde or an x followed by zero or more
y's". For single characters you can also say things like "[aeiouy]"
meaning "a or e or i or o or u or y" or "[a-z]" meaning "any unaccented
lower case letter".
The "and", when sequence is immaterial, is much harder if not impossible
:-( So "abc" means "a and b and c" but *in that sequence*. If you want
to say "a and b and c in any sequence" then I don't know how to do it.
Of course, if there are only a few possibilities then you could "or" all
the possible permutations ; "(abc)|(acb)|(bac)|(bca)|(cab)|(cba)" but
that's not practical in the general case. I don't think even perl (the
doyen of REs) can do this.
Please note that I'm using OOo 2.4. I'm not sure if the vertical bar is
available in previous versions.
I thank you in advance
Kindest regards
P.S: excuse my poor English: I'm a french man...
Your English is much better than my French ...
--
Harold Fuchs
London, England
Please reply *only* to users@openoffice.org
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]