Using Find and Replace

From NeoWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 07:34, 24 May 2005 (edit)
Sardisson (Talk | contribs)
m (update)
← Previous diff
Revision as of 23:54, 24 May 2005 (edit) (undo)
( | contribs)
(Finding and replacing tabs, rturns and blank lines)
Next diff →
Line 7: Line 7:
=== Returns/Blank Lines === === Returns/Blank Lines ===
-* standard: check "Regular Expressions" box, then fill in <tt>^$</tt> (end of paragraph), <tt>$</tt> (end of line)+* Search and replace of formatting characters, such as returns (paragraph ends) and tabs can '''only''' be done by using the regular expression feature. You can't paste these characters into the search and replace fields.
-* there is no way to replace two returns; Iannz's Find & Replace Macro will do this+
-=== Tabs ===+*Check the "Regular Expressions" box in the Search dialog, then fill in the codes required. These are given in the online help, but the explanations are not very clear.
-* <tt>\t</tt> for some strange reason+*<tt>^$</tt> as the search term will find and select for replacement empty paragraphs, but <tt>^$^$</tt> does not find adjacent empty paragraphs - it returns no matches.
-=== Etc. ===+*<tt>$</tt> as the search term finds and selects for replacement all end-of-line characters, but <tt>any text$</tt> finds and selects occurrences of <tt>any text</tt> at the end of lines, without selecting the end-of-line charter itself.
 +
 +* There is no way to replace two returns; Iannz's Find & Replace Macro will do this.
 + 
 +*You cannot use <tt>^</tt> or <tt>$</tt> in the replace field to insert paragraphs - it has to be <tt>\n</tt>
 + 
 +=== Tabs ===
-* Codes of "Find" box different from those of "Replace" box+* <tt>\t</tt> represents a tab character. This behaves in a sane manner, as <tt>\t\t</tt> is two tabs, etc, and it is the same code in both find and replace.

Revision as of 23:54, 24 May 2005

OpenOffice.org and thus NeoOffice/J use a somewhat convoluted Find-and-Replace syntax. This page will hopefully demystify some of the commonly-used commands.

Returns/Blank Lines

  • Search and replace of formatting characters, such as returns (paragraph ends) and tabs can only be done by using the regular expression feature. You can't paste these characters into the search and replace fields.
  • Check the "Regular Expressions" box in the Search dialog, then fill in the codes required. These are given in the online help, but the explanations are not very clear.
  • ^$ as the search term will find and select for replacement empty paragraphs, but ^$^$ does not find adjacent empty paragraphs - it returns no matches.
  • $ as the search term finds and selects for replacement all end-of-line characters, but any text$ finds and selects occurrences of any text at the end of lines, without selecting the end-of-line charter itself.
  • There is no way to replace two returns; Iannz's Find & Replace Macro will do this.
  • You cannot use ^ or $ in the replace field to insert paragraphs - it has to be \n

Tabs

  • \t represents a tab character. This behaves in a sane manner, as \t\t is two tabs, etc, and it is the same code in both find and replace.
Personal tools