Documentation/How Tos/Regular Expressions in Calc

From Apache OpenOffice Wiki
< Documentation‎ | How Tos
Revision as of 04:21, 25 October 2007 by Drking (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Introduction:

In simple terms regular expressions are a clever way to find text.


A typical use for regular expressions is in finding text; for instance to locate all cells containing man or woman in your spreadsheet, you could search using a single regular expression.


Regular expressions in Calc and Writer

Regular expressions are available in Calc as follows:

  • Edit - Find & Replace dialog
  • Data - Filter - Standard filter
  • Functions, such as SUMIF, LOOKUP

The best way to learn about regular expressions in Calc is to start by understanding how to use Find & Replace. This is covered by the 'HowTo for Regular Expressions in Writer', which you should read.


In Calc, regular expressions are applied separately to each cell. (You'll see that regular expressions are applied separately to each paragraph in Writer.) So a search for 'r.d' will match red in cell A1 but will not match 'r' in cell A2 with 'd' (or 'ed') in cell A3. (The regular expression 'r.d' means 'try to match 'r' followed by another character followed by 'd' ').

Personal tools