Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Search and replace regular expression in Open Office calc

I've got something like this (in Open Office Calc):

Streetname. Number
Streetname. Number a

etc. Now I want to delete everything in front of the number. So I need to do a search and replace I guess. ^.*?([0-9]) this one matches Streetname. Number .. but what should I put in the replace field? If I do the search and replace, it deletes everything within the datafield :(

like image 763
Chris8080 Avatar asked Jul 31 '10 07:07

Chris8080


People also ask

How is Find and Replace option is useful in Open Office Writer?

Writer has a Find and Replace feature that automates the process of searching for text inside a document. In addition to finding and replacing words and phrases, you can: Use wildcards and regular expressions to fine-tune a search.

How do you remove special characters in OpenOffice?

Click a character in the Character table to select it. The Delete button will remove all characters from the Characters field.

How many types of referencing is used in Open Office Calc?

There are two types of cell references: relative and absolute. Relative and absolute references behave differently when copied and filled to other cells or when using the autofill feature of Calc. Relative references change when a formula is copied to another cell.


1 Answers

In Search for field, write the following regex: (.*?[:space:])([0-9]+)

And in Replace with, write: $2

That means that you search for:

  1. any characters followed by a space
  2. one or more digits.

Replace all that with $2 - the reference to the digits.

It will replace Streetname. Number 24 with 24. Why did you put a in your example?

like image 85
True Soft Avatar answered Oct 07 '22 21:10

True Soft