You should post your code...

On 10/24/2009 06:05 AM, Johnny Rosenberg wrote:
I am coding something in OpenOffice.org Calc using the built in Basic
language thing. Now, when I produced about 50 KiB of code I found that
I was not very consistent in how to type things. For example,
sometimes I type like ”BlahBlah=Foo+Bar-3” and sometimes like
”BlahBlah=Foo + Bar - 3”. So I figured that it wouldn't be too hard to
search for patterns using regular expressions for replacing things,
but I failed doing this!

Thing like work perfectly in OpenOffice.org Writer Search and Replace
doesn't seem to work at OpenOffice.org Basic Search and Replace.
One thing that I need to do this, I guess, is things like $1, $2 and
things like that in the Replace field, but all happens is that my
search string is replaces by $1 and $2 respectively. Of course the
Regular Expression checkbox is ticked.

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?

Johnny Rosenberg

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



--
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