I want to find and select any words or phrases in parentheses, so that I can italicize them. If possible, I also want to select any punctuation after the closing parenthesis.
For example, I want to italicise like this:
Craving arises from the feeling (vedanā) produced by contact (phassa), which in turn depends on the six sense-bases (saḷāyatana) such as the eye and visual form. Sense-bases are the product of mind and matter (nāmarūpa), which depend on consciousness (viññāṇa).
[Solved] RegEx: Finding all Words in Parenthesis
- Bhikkhu Pesala
- Posts: 1253
- Joined: Mon Oct 08, 2007 1:27 am
[Solved] RegEx: Finding all Words in Parenthesis
Last edited by Bhikkhu Pesala on Tue Jan 15, 2008 11:32 pm, edited 1 time in total.
Idiot Compassion
LibreOffice 6.0.4 on Windows 10
LibreOffice 6.0.4 on Windows 10
Re: RegEx: Finding all words in Parenthesis
\(([^ ])+\) will do, if you don't want spaces in parentheses. If you search for any series of characters in () you get into problems with OOo being greedy, so it selects too much.
LibreOffice 25.8.4.2 on Ubuntu Linux
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
- Bhikkhu Pesala
- Posts: 1253
- Joined: Mon Oct 08, 2007 1:27 am
Re: RegEx: Finding all words in Parenthesis
Thanks, that did it. I did a separate search for \(([^ ])+\), and \(([^ ])+\); to find the parentheses followed by punctuation. ). is not too bad, but ); doesn't look too good if the ; is not italicized.
Idiot Compassion
LibreOffice 6.0.4 on Windows 10
LibreOffice 6.0.4 on Windows 10
Re: [Solved] RegEx: Finding all Words in Parenthesis
I actually thought you were pulling my leg.
And I don't like the look of parentheses in italics. Btw, did you know that some people actually claim that (some text) doesn't mean the same thing as (some text)?
LibreOffice 25.8.4.2 on Ubuntu Linux
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
Re: [Solved] RegEx: Finding all Words in Parenthesis
Another approach:
Code: Select all
\([^)]*\)[^ ]?AOO4/LO5 • Linux • Fedora 23