2

I have a huge, long list in Open Office Writer and I like to remove some parts of the text, but manually it would take days. Can anyone tell me how to make a regular expression to remove everything between brackets in the text? Here's the example. The text now looks like this:

word word word (number word)
word word (word word)
numbers word (word number word)
word (numbers)
etc....

I would like it to look like this:

word word word
word word
numbers word
word
etc....

So I would like to remove everything from brackets + the brackets themselves too.

2

You would have to do a line by line search and remove the brackets. See the example I've cooked up here. You can use many online regex tools to try this

This is the regex i came up with. I don't have openoffice so can't test it in that.

Assuming this is the screen you are looking at:

screenshot

This regular expression should work

(\(.*\))
3
  • Sorry it doesn't work. Your example does find each line that contains words inside brackets and if I use "find&replace with", it removes them but it also removes everything before and after the brackets too. I need something that only removes the words inside brackets but leaves everything else before and after them. Oct 13 '16 at 18:12
  • screenshot is this the correct screen? If so then just try this (\(.*\)) Oct 13 '16 at 18:15
  • You are welcome, will edit the answer to reflect the changes Oct 13 '16 at 18:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.