Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




OpenOffice Writer 3.x Guide
Previous Page Home Next Page

Use wildcards (regular expressions)

Wildcards (also known as regular expressions) are combinations of characters that instruct OOo how to search for something. Regular expressions are very powerful but not very intuitive. They can save time and effort by combining multiple finds into one.

Table 1 shows a few of the regular expressions used by OOo.

Image:Tip.png The online help describes many more regular expressions and their uses.
Image:documentation_note.png One of the most common mistakes when using regular expressions is to try to search for a character that is defined as a wildcard, such as brackets or dots. If you need to search for such a character, type a backslash (\) before it. This instructs OOo to treat the character following the backslash as a normal character. For example, to find the text $5.00 ($ and . are wildcard characters), you would conduct a search using \$5\.00.

To use wildcards and regular expressions when searching and replacing:

  1. On the Find & Replace dialog box, click More Options to see more choices. On this expanded dialog box, select the Regular expressions option.
  2. Type the search text, including the wildcards, in the Search for box and the replacement text (if any) in the Replace with box. Not all regular expressions work as replacement characters; the line break (\n) is one that does work.
  3. Click Find, Find All, Replace, or Replace All (not recommended).
Expanded Find & Replace dialog box.

Table 1. Examples of search wildcards (regular expressions)

To find Use this expression Examples and comments
Any single character . b.d finds bad, bud, bid, and bed.
Characters at the beginning of a paragraph ^chars ^term
Characters at the end of a paragraph chars$ term.$
One of the specified characters [xyz] b[iu]n finds bin and bun.
Any single character in this range [x-y] [r-t]eed finds reed, seed, and teed; ranges must be in alphabetically ascending order.
Any single character except the characters inside the brackets [^x] p[^a]st finds post and pest, but not past.
The beginning of a word \<start \<log finds logbook and logistics, but not catalog.
The end of a word end\> log\> finds catalog, but not logistics.
A paragraph marker $ Does not work as a replacement character. Use \n instead.
An empty paragraph ^$
An tab character \t
A line break \n Finds a line break that was inserted with Shift+Enter. When used as a replacement character, it inserts a paragraph marker.

OpenOffice Writer 3.x Guide
Previous Page Home Next Page

  Published under the terms of the Creative Commons License Design by Interspire