On 10/28/2009 12:32 PM, Johnny Rosenberg wrote:
2009/10/28 Jan Holst Jensen<j...@biochemfusion.com>:
Andrew Douglas Pitonyak wrote:
You should post your code...

On 10/24/2009 06:05 AM, Johnny Rosenberg wrote:
One example:
Search for: ([a-zA-Z0-9\(\)])([\+|\-|\*|\/])([a-zA-Z0-9\(\)])
Replace with: $1 $2 $3

I tried this in OpenOffice.org Writer and it works perfectly.

Before:
a+b
hej(3)+svejs(4)
tjoho(x)+3

After:
a + b
hej(3) + svejs(4)
tjoho(x) + 3

Doing the same thing in OpenOffice.org Basic:

Before:
a+b
hej(3)+svejs(4)
tjoho(x)+3

After:
$1 $2 $3
hej(3$1 $2 $3vejs(4)
tjoho(x$1 $2 $3

Doesn't look very nice to me…

Is this a bug or am I not supposed to do this?
I believe that is exactly what Johnny did. I can reproduce it from the
above. Writer reformats the text in a document so the spacing is nicer. In
the Basic code editor the replace action inserts "$1 $2 $3" which is pretty
useless. At least I can conclude that regular expression search/replace
works differently in a Writer text document and in the Basic editor.

Cheers
-- Jan
I think that Andrew maybe misunderstood me a bit there, and that you
then misunderstood him, but maybe I am wrong. Just in case I am right,
I will just point out that I use the ordinary Ctrl+F search in my code
to replace things. I did NOT write a Search&  Replace macro of my own
or anything like that.
All I wanted to do was to make my code look more consistent, making
sure that spaces and things like that are used the same way in all
code of the project, making it easier to read and nicer to look at…

So there is no point to post any kind of code, since the same thing
happens for any kind of text, for example the text I used in my
examples in my original post.

Johnny Rosenberg
Oh my, yes, I thought that I was reading the dev forum, and I thought that this was only with respect to a macro. <sigh>

Sorry

--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org

Reply via email to