Re: [users] Regular Expression

2006-07-01 Thread John W. Kennedy
Dennis Marks wrote: I'm trying to to a find and replace using regular expressions. I have sentences in the format "nn:nn x". I want to replace it with "nn:nn tabcharacter ". Example "1:34 Now is the time" replace with "1:34 tabcharacter Now is the time". I use "([0-9]+:[0-9]+

Re: [users] Regular Expression

2006-07-01 Thread kevin johnston
As far as I can tell, from the documentation and my own experiments, OOo does not save "backreferences" from the search pattern to use in the replacement pattern. Even in a Regular Expression *search*, the *replacement* expression is not a regular expression, it's a simple text string. I've

Re: [users] Regular Expression

2006-07-01 Thread Donald H Locker
The way I read the documentation (help file), the \n reference is only available in the search string, not in the replacement string. Characters which also may be used in the replacement string are called out to be so (e.g. \t) The special character & is mentioned to do what you want, but it o

[users] Regular Expression

2006-07-01 Thread Dennis Marks
I'm trying to to a find and replace using regular expressions. I have sentences in the format "nn:nn x". I want to replace it with "nn:nn tabcharacter ". Example "1:34 Now is the time" replace with "1:34 tabcharacter Now is the time". I use "([0-9]+:[0-9]+ )" in the find and "\

RE: [users] Regular Expression for data in parentheses

2005-12-29 Thread Knight, Jon
Ian ... that did it. And thanks to your explanation, I understand why. ¡Muchas gracias! Jon -Original Message- From: Ian Laurenson [mailto:[EMAIL PROTECTED] Sent: Thursday, December 29, 2005 9:12 PM To: users@openoffice.org Subject:Re: [users] Regular Expression for

Re: [users] Regular Expression for data in parentheses

2005-12-29 Thread Ian Laurenson
On Thu, 2005-12-29 at 18:30 -0600, Knight, Jon wrote: > In Writer, I'd like to Search & Replace all occurrences of data enclosed in > parentheses. I'm able to do so in MS Word by using "\(*\)" as a regular > expression, without the double-quotes of course. I have read the regular > expression sec

RE: [users] Regular Expression for data in parentheses

2005-12-29 Thread Knight, Jon
Well, thanks for the help (Keith & JC). At least, I'm one step closer! Jon -Original Message- From: Keith Bates [mailto:[EMAIL PROTECTED] Sent: Thursday, December 29, 2005 8:45 PM To: users@openoffice.org Subject:Re: [users] Regular Expression for data in pa

Re: [users] Regular Expression for data in parentheses

2005-12-29 Thread Keith Bates
On Thu, 29 Dec 2005 20:27:01 -0600 "Knight, Jon" <[EMAIL PROTECTED]> wrote: > Alright, that works! (Thanks for steering me.) Is there anyway to > turn off the "longest match" rule? When I've got something like > "(data) text (data)", the whole bit is matched when I'd rather get > two separate m

RE: [users] Regular Expression for data in parentheses

2005-12-29 Thread Knight, Jon
ssage- From: Keith Bates [mailto:[EMAIL PROTECTED] Sent: Thursday, December 29, 2005 6:56 PM To: users@openoffice.org Subject:Re: [users] Regular Expression for data in parentheses On Thu, 29 Dec 2005 18:30:13 -0600 "Knight, Jon" <[EMAIL PROTECTED]> wrote: >

Re: [users] Regular Expression for data in parentheses

2005-12-29 Thread JC Helary
In Writer, I'd like to Search & Replace all occurrences of data enclosed in parentheses. I'm able to do so in MS Word by using "\(*\)" as a regular expression, without the double-quotes of course. I have read the regular expression section in the OO help, but nothing I try is successful.

Re: [users] Regular Expression for data in parentheses

2005-12-29 Thread Keith Bates
On Thu, 29 Dec 2005 18:30:13 -0600 "Knight, Jon" <[EMAIL PROTECTED]> wrote: > Using OO 2.0.1 on Windows ... > > In Writer, I'd like to Search & Replace all occurrences of data > enclosed in parentheses. I'm able to do so in MS Word by using > "\(*\)" as a regular expression, without the double-q

[users] Regular Expression for data in parentheses

2005-12-29 Thread Knight, Jon
Using OO 2.0.1 on Windows ... In Writer, I'd like to Search & Replace all occurrences of data enclosed in parentheses. I'm able to do so in MS Word by using "\(*\)" as a regular expression, without the double-quotes of course. I have read the regular expression section in the OO help, but nothin

Re: [users] Regular expression for several spaces that does not match a single space

2005-01-30 Thread kevin johnston
Don't put the question marks in the expression. What you want is just [:space:][:space:][:space:][:space:][:space:][:space:][:space:][:space:]. A question mark means "match this character 0 times or 1 time only". What is happening for you is that for every space character in your document, one

Re: [users] Regular expression for several spaces that does not match a single space

2005-01-26 Thread Mark Kirchner
On Wednesday, January 26, 2005, 3:00:30 PM, Mark Kirchner wrote: >> [:space:]?[:space:]?[:space:]?[:space:]?[:space:]?[:space:]?[:space:]? > > [:space:]? means: One OR zero spaces (because of the "?"). So the > complete expression will match anything from 0 to 8 spaces. Ugh, copy & paste error: Th

Re: [users] Regular expression for several spaces that does not match a single space

2005-01-26 Thread Mark Kirchner
On Wednesday, January 26, 2005, 2:38:53 PM, David Teague wrote: > I want to replace the leading 8 spaces with 4. If I use eight of the > regular expression [:space:]?, as > > [:space:]?[:space:]?[:space:]?[:space:]?[:space:]?[:space:]?[:space:]? [:space:]? means: One OR zero spaces (because of the

Re: [users] Regular expression for several spaces that does not match a single space

2005-01-26 Thread Cyrille Moureaux
Hi David, I want to replace the leading 8 spaces with 4. If I use eight of the regular expression [:space:]?, as [:space:]?[:space:]?[:space:]?[:space:]?[:space:]?[:space:]?[:space:]? In regular expressions, normally the ? cardinality means 0 or 1 occurrence, so that expression would match any num

[users] Regular expression for several spaces that does not match a single space

2005-01-26 Thread David Teague
I have some C++ code with annoyingly many spaces of indentation. I want to replace the leading 8 spaces with 4. If I use eight of the regular expression [:space:]?, as [:space:]?[:space:]?[:space:]?[:space:]?[:space:]?[:space:]?[:space:]? and replace with say four of them, the find button in