OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Find and replace

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer
View previous topic :: View next topic  
Author Message
Weatherlawyer
OOo Enthusiast
OOo Enthusiast


Joined: 28 Feb 2006
Posts: 154
Location: England

PostPosted: Wed May 14, 2008 1:31 pm    Post subject: Find and replace Reply with quote

So why doesn't the dollar sign work as a regular expression in the Replace With box?

Maybe I am missing some carefully crafted code here but WTF?
Back to top
View user's profile Send private message Yahoo Messenger
floris_v
Moderator
Moderator


Joined: 12 Jul 2007
Posts: 4791
Location: Netherlands

PostPosted: Wed May 14, 2008 2:00 pm    Post subject: Reply with quote

It doesn't work in the Replace by box, as you can find in the Help that comes with the program. You can't replace across paragraphs. I suppose that's intentional.
_________________
LibreOffice 3.6.3; OOo 3.4.1 on Windows Vista
Join the Official community forum - in several languages, including Nederlandstalig forum
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Wed May 14, 2008 3:09 pm    Post subject: Reply with quote

I can't answer the why question but \n means a paragraph break in the Replace box.
Back to top
View user's profile Send private message
Weatherlawyer
OOo Enthusiast
OOo Enthusiast


Joined: 28 Feb 2006
Posts: 154
Location: England

PostPosted: Wed May 14, 2008 5:44 pm    Post subject: Reply with quote

JohnV wrote:
I can't answer the why question but \n means a paragraph break in the Replace box.


No. That's a line break, is it not?

Of course if you publish the whole article to Google groups or somewhere like it, you can copy it from there and that will give you the paragraph spaces in line breaks.

A bit of a long winded way of doing things and not exactly the smartest thing you can do with a document you are working on but a workaround I suppose.

I'll give it a go though. Thanks.

.........................................

Cockamamie way of doing things. I hope they do something about regular expressions for version 3. It's a nightmare.

OK it did work.

So what is the regular expression for line break in the "replace with" box in find and replace? Or to put it another way why bother with the twopenny-halfpenny dollar when the line break function is adequate?
Back to top
View user's profile Send private message Yahoo Messenger
floris_v
Moderator
Moderator


Joined: 12 Jul 2007
Posts: 4791
Location: Netherlands

PostPosted: Wed May 14, 2008 10:48 pm    Post subject: Reply with quote

It's worse than what you're saying. IN the Search box \n means line break; in the Replace box it's a paragraph break. It's fully documented, and therefore intentional, but bless me if I know why they did it like this.
_________________
LibreOffice 3.6.3; OOo 3.4.1 on Windows Vista
Join the Official community forum - in several languages, including Nederlandstalig forum
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Thu May 15, 2008 5:22 am    Post subject: Reply with quote

And there is no regex for a line break in the Replace box. Rolling Eyes
Back to top
View user's profile Send private message
ftack
Moderator
Moderator


Joined: 27 Jan 2003
Posts: 3102
Location: Belgium

PostPosted: Sat May 17, 2008 4:47 am    Post subject: Reply with quote

The "why" is that certain regex symbols do not represent a character. They represent a "property". Thus, "Office$" means the string "Office" at the end of a paragraph. "^This" is a "This" at the start of a paragraph.

Why is it all so difficult? that is another why, but one I can not answer Wink
_________________
--
GNU/Linux (Ubuntu)
Back to top
View user's profile Send private message
Gudmund
General User
General User


Joined: 30 Nov 2005
Posts: 5

PostPosted: Mon May 19, 2008 11:28 am    Post subject: Intentional = patchup Reply with quote

floris_v wrote:
IN the Search box \n means line break; in the Replace box it's a paragraph break. It's fully documented, and therefore intentional, but bless me if I know why they did it like this.


AFAIR, the only thing intentional in documenting this weird behaviour is that the documentation has been retrofitted to reflect reality. See e. g.

http://www.openoffice.org/issues/show_bug.cgi?id=70554
http://www.openoffice.org/issues/show_bug.cgi?id=46165
http://www.openoffice.org/issues/show_bug.cgi?id=25177
http://www.openoffice.org/issues/show_bug.cgi?id=15666

If you're lucky, the regex handling should be improved in 2.4 and
handling \n, \r etc. might work, but I strongly doubt it. Haven't gotten around to testing it yet, sorry.

The ICU regex engine is mentioned in one of the above threads as something that might be used in OOo.
<http://www.icu-project.org/userguide/regexp.html>
_________________
Gudmund Areskoug
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group