Find & Replace and \t expression [Writer]

Hallo everyone.
Recently I switched to LibreOffice 4 and I have some problem with Tabs in Find & Replace window. If I want to use \t expression in the Replace with box it doesn't work (in older version there was no problem with that). \t expression is treated literally, its special meaning is suppressed. At the same time \t used in Search for box works fine. Of course Regular expressions box is checked. What am I doing wrong? Any help will be appreciated. Regards,

gordom

I replaced tabs using \t with regular expressions clicked on in Replace. No other options were selected. This was in Writer (4.0.2.10) on Linux Mint 13/64

W dniu 2013-04-05 02:39, Jay Lozier pisze:

Hallo everyone.
Recently I switched to LibreOffice 4 and I have some problem with Tabs
in Find & Replace window. If I want to use \t expression in the
Replace with box it doesn't work (in older version there was no
problem with that). \t expression is treated literally, its special
meaning is suppressed. At the same time \t used in Search for box
works fine. Of course Regular expressions box is checked. What am I
doing wrong? Any help will be appreciated. Regards,

gordom

I replaced tabs using \t with regular expressions clicked on in Replace.
No other options were selected. This was in Writer (4.0.2.10) on Linux
Mint 13/64

Does it mean that you can both:
- search for tabs using \t expression and also
- replace any symbol with tab using \t expression
???

I use LO 4.0.2.2 on Win XP SP 3 and I can only search for tabs using \t expression but I can't replace any symbols with a tab.

Regards,
gordom

W dniu 2013-04-05 02:39, Jay Lozier pisze:

Hallo everyone.
Recently I switched to LibreOffice 4 and I have some problem with Tabs
in Find & Replace window. If I want to use \t expression in the
Replace with box it doesn't work (in older version there was no
problem with that). \t expression is treated literally, its special
meaning is suppressed. At the same time \t used in Search for box
works fine. Of course Regular expressions box is checked. What am I
doing wrong? Any help will be appreciated. Regards,

gordom

I replaced tabs using \t with regular expressions clicked on in Replace.
No other options were selected. This was in Writer (4.0.2.10) on Linux
Mint 13/64

Does it mean that you can both:
- search for tabs using \t expression and also
- replace any symbol with tab using \t expression
???

With regular expression checked I searched for /t and as test replaced with a. I believe the opposite direction will work since /t is the escape sequence for tab. The /t usage dates way back as a method of identifying where tabs are located.

W dniu 2013-04-05 14:39, Jay Lozier pisze:

W dniu 2013-04-05 02:39, Jay Lozier pisze:

Hallo everyone.
Recently I switched to LibreOffice 4 and I have some problem with Tabs
in Find & Replace window. If I want to use \t expression in the
Replace with box it doesn't work (in older version there was no
problem with that). \t expression is treated literally, its special
meaning is suppressed. At the same time \t used in Search for box
works fine. Of course Regular expressions box is checked. What am I
doing wrong? Any help will be appreciated. Regards,

gordom

I replaced tabs using \t with regular expressions clicked on in Replace.
No other options were selected. This was in Writer (4.0.2.10) on Linux
Mint 13/64

Does it mean that you can both:
- search for tabs using \t expression and also
- replace any symbol with tab using \t expression
???

With regular expression checked I searched for /t and as test replaced
with a. I believe the opposite direction will work since /t is the
escape sequence for tab. The /t usage dates way back as a method of
identifying where tabs are located.

Obviously it doesn't work for me. I'm able to search for \t but I can't use \t in replace with box. But I agree, it use to work in previous versions of OO and LO indeed. Something was changed in LO 4. This problem occurs at least on my machine.

W dniu 2013-04-05 14:39, Jay Lozier pisze:

W dniu 2013-04-05 02:39, Jay Lozier pisze:

Hallo everyone.
Recently I switched to LibreOffice 4 and I have some problem with Tabs
in Find & Replace window. If I want to use \t expression in the
Replace with box it doesn't work (in older version there was no
problem with that). \t expression is treated literally, its special
meaning is suppressed. At the same time \t used in Search for box
works fine. Of course Regular expressions box is checked. What am I
doing wrong? Any help will be appreciated. Regards,

gordom

I replaced tabs using \t with regular expressions clicked on in Replace.
No other options were selected. This was in Writer (4.0.2.10) on Linux
Mint 13/64

Does it mean that you can both:
- search for tabs using \t expression and also
- replace any symbol with tab using \t expression
???

With regular expression checked I searched for /t and as test replaced
with a. I believe the opposite direction will work since /t is the
escape sequence for tab. The /t usage dates way back as a method of
identifying where tabs are located.

Obviously it doesn't work for me. I'm able to search for \t but I can't use \t in replace with box. But I agree, it use to work in previous versions of OO and LO indeed. Something was changed in LO 4. This problem occurs at least on my machine.

I just noticed we are using different OSes and builds (Linux Mint and 4.0.2.1). \t works fine for me so I wonder if there is a regression in 4.0.2.2. I doubt the OS difference is important.

W dniu 2013-04-05 02:39, Jay Lozier pisze:

Hallo everyone.
Recently I switched to LibreOffice 4 and I have some problem with Tabs
in Find & Replace window. If I want to use \t expression in the
Replace with box it doesn't work (in older version there was no
problem with that). \t expression is treated literally, its special
meaning is suppressed. At the same time \t used in Search for box
works fine. Of course Regular expressions box is checked. What am I
doing wrong? Any help will be appreciated. Regards,

gordom

I replaced tabs using \t with regular expressions clicked on in Replace.
No other options were selected. This was in Writer (4.0.2.10) on Linux
Mint 13/64

Does it mean that you can both:
- search for tabs using \t expression and also
- replace any symbol with tab using \t expression
???

With regular expression checked I searched for /t and as test replaced with
a.

Yes, that seems to work for the OP too, so that was not what he was
asking, as it seems.

I believe the opposite direction will work since /t is the escape
sequence for tab.

It seems like the OP believed that too, but still it didn't work.

The /t usage dates way back as a method of identifying
where tabs are located.

Yes, the OP mentioned that too in his first post. Still it didn't work for him.
And you didn't even try it, so still he knows absolutely nothing more
than before creating this thread.
Unfortunately I am still with 3.6, so I can't help either. Sorry for that.

Johnny Rosenberg

W dniu 2013-04-05 16:19, Jay Lozier pisze:

I just noticed we are using different OSes and builds (Linux Mint and
4.0.2.1). \t works fine for me so I wonder if there is a regression in
4.0.2.2. I doubt the OS difference is important.

Well, I made some farther tests (also using OO 3.0.1 and LO 4.0.1.2 - both portable versions). It seems that all of these builds are affected, so I wasn't quite strict previously. Anyway, I found the solution (however the results are a little bit odd to me). Let say there is some text e.g.:

Arg aarega aerga aerg
arga opjwg nklsawertg
Wnmikfg erger 8
fm fbdklfn bfg'mlkfg

I want to put a tab in the end of each line. If I search for $ and replace it with \t\n I will get the following result (\t is treated literally):

Arg aarega aerga aerg\t
arga opjwg nklsawertg\t
Wnmikfg erger 8\t
fm fbdklfn bfg'mlkfg\t

But if I search for last symbol of each line by putting .$ and replace it with &\t I got what I wanted (i.e. tab in the end of each line).

Two step approach also works. I can search for the line ending mark using $ and replace it with any temporary symbol that will be replaced by tab \t later on.

I still don't know why $ expression can't be replaced into \t directly.

Regards,
gordom

I replaced tabs using \t with regular expressions clicked on in Replace.

/snip/

No other options were selected. This was in Writer (4.0.2.10) on Linux
Mint 13/64

Does it mean that you can both:
- search for tabs using \t expression and also
- replace any symbol with tab using \t expression
???

With regular expression checked I searched for /t and as test replaced with a. I believe the opposite direction will work since /t is the escape sequence for tab. The /t usage dates way back as a method of identifying where tabs are located.

I use LO 4.0.2.2 on Win XP SP 3 and I can only search for tabs using \t expression but I can't replace any symbols with a tab.

Regards,
gordom

Is there someplace one can find a list of these escape sequences that might be used for search and replace?
--doug

W dniu 2013-04-05 18:02, Doug pisze:

I replaced tabs using \t with regular expressions clicked on in Replace.

/snip/

No other options were selected. This was in Writer (4.0.2.10) on Linux
Mint 13/64

Does it mean that you can both:
- search for tabs using \t expression and also
- replace any symbol with tab using \t expression
???

With regular expression checked I searched for /t and as test replaced
with a. I believe the opposite direction will work since /t is the
escape sequence for tab. The /t usage dates way back as a method of
identifying where tabs are located.

I use LO 4.0.2.2 on Win XP SP 3 and I can only search for tabs using
\t expression but I can't replace any symbols with a tab.

Regards,
gordom

Is there someplace one can find a list of these escape sequences that
might be used for search and replace?
--doug

https://help.libreoffice.org/Common/List_of_Regular_Expressions

And some more information you might find useful can be found here I think:
http://tinyurl.com/c8jj86f
http://userguide.icu-project.org/strings/regexp

Regards,
gordom

As Gordom has found OpenOffice regular expression handling in Find/Replace
is a little weird, full function in find but a bit limited in the replace.
But it all functions well enough once you get past the warts.

I think the best write up still lies with the Apache OpenOffice project
wiki:

http://wiki.openoffice.org/wiki/Documentation/How_Tos/Regular_Expressions_in_Writer

Hi :slight_smile:
I found this 'old' thread.  Hopefully helps with the current question about searching for Nemo.
Regards from
Tom :slight_smile: