| View previous topic :: View next topic |
| Author |
Message |
regnbage General User

Joined: 17 Sep 2010 Posts: 30
|
Posted: Tue Nov 30, 2010 3:27 am Post subject: [Solved] Searching for words with mixed formatting |
|
|
Is it possible to search for words with mixed formatting? For example, if the text has normal formatting, but some words have a letter or two in italic, how to find the words which have a letter in italic?
Last edited by regnbage on Tue Nov 30, 2010 8:44 am; edited 2 times in total |
|
| Back to top |
|
 |
Robert Tucker Moderator


Joined: 16 Aug 2004 Posts: 3367 Location: Manchester UK
|
Posted: Tue Nov 30, 2010 4:29 am Post subject: |
|
|
Ctrl+F
Put full stop (period) . in "Search for" box. Click "More Options". Check "Regular expressions". Click "Format". Under "Font" tab select Italics. Click "Find". _________________ LibreOffice 3.6.6 on Fedora 18, LibreOffice 4.0.2 on Ubuntu 13.04 (Double Boot) |
|
| Back to top |
|
 |
regnbage General User

Joined: 17 Sep 2010 Posts: 30
|
Posted: Tue Nov 30, 2010 4:48 am Post subject: |
|
|
| I'm sorry for not being correct in the first place. Many of the words are wholly italic. So I only need to find mixed words. |
|
| Back to top |
|
 |
Robert Tucker Moderator


Joined: 16 Aug 2004 Posts: 3367 Location: Manchester UK
|
Posted: Tue Nov 30, 2010 6:04 am Post subject: |
|
|
You could try this:
Search for .* in format italics and replace with <i>&</i> (much as my first post)
Search for: ([^a-z])(<i>)([a-z]) "no format"
Replace with: $1<f>$3
Search for: ([a-z])(</i>)([^a-z])
Replace with: $1</f>$3
Search for: <f>|</f> and replace with nothing (empty "Replace with" box)
Search for: <i>|</i> "Find all"
Sorry, best I could come up with. _________________ LibreOffice 3.6.6 on Fedora 18, LibreOffice 4.0.2 on Ubuntu 13.04 (Double Boot) |
|
| Back to top |
|
 |
regnbage General User

Joined: 17 Sep 2010 Posts: 30
|
Posted: Tue Nov 30, 2010 8:43 am Post subject: |
|
|
I'm sorry, but nothing is found with following lines:
| Code: | | ([^a-z])(<i>)([a-z]) |
| Code: | | ([a-z])(</i>)([^a-z]) |
Though, if in the second step Search for all:
and then make it normal, most of the "wrong italic" will be corrected as usually there is only one such letter in succession.
Thanks for helping me.
Last edited by regnbage on Tue Nov 30, 2010 9:24 am; edited 1 time in total |
|
| Back to top |
|
 |
Robert Tucker Moderator


Joined: 16 Aug 2004 Posts: 3367 Location: Manchester UK
|
Posted: Tue Nov 30, 2010 9:08 am Post subject: |
|
|
| regnbage wrote: | I'm sorry, but nothing is found with following lines:
| Code: | | ([^a-z])(<i>)([a-z]) |
| Code: | | ([a-z])(</i>)([^a-z]) |
|
But you did get the italics between the tags? Did you remove the italic format under the "Search for" box by clicking the "No Format" button? _________________ LibreOffice 3.6.6 on Fedora 18, LibreOffice 4.0.2 on Ubuntu 13.04 (Double Boot) |
|
| Back to top |
|
 |
regnbage General User

Joined: 17 Sep 2010 Posts: 30
|
Posted: Tue Nov 30, 2010 9:23 am Post subject: |
|
|
| Robert Tucker wrote: | | But you did get the italics between the tags? Did you remove the italic format under the "Search for" box by clicking the "No Format" button? |
Yes and yes. |
|
| Back to top |
|
 |
Robert Tucker Moderator


Joined: 16 Aug 2004 Posts: 3367 Location: Manchester UK
|
Posted: Tue Nov 30, 2010 9:40 am Post subject: |
|
|
Odd:
 _________________ LibreOffice 3.6.6 on Fedora 18, LibreOffice 4.0.2 on Ubuntu 13.04 (Double Boot) |
|
| Back to top |
|
 |
regnbage General User

Joined: 17 Sep 2010 Posts: 30
|
Posted: Tue Nov 30, 2010 11:46 pm Post subject: |
|
|
Stupid me the text is in cyrillic with the only one latin letter 'I'. Besides, a letter in "wrong italic" format can have a space or period character next to it.
Try the following example, and you'll see that not all the tags are found, anyway.
nnn <i>i </i>nnn n<i>i</i>n nnn |
|
| Back to top |
|
 |
Robert Tucker Moderator


Joined: 16 Aug 2004 Posts: 3367 Location: Manchester UK
|
Posted: Wed Dec 01, 2010 12:06 am Post subject: |
|
|
Try replacing all italic spaces (and periods) with normal spaces (and periods) before you start. _________________ LibreOffice 3.6.6 on Fedora 18, LibreOffice 4.0.2 on Ubuntu 13.04 (Double Boot) |
|
| Back to top |
|
 |
regnbage General User

Joined: 17 Sep 2010 Posts: 30
|
Posted: Fri Dec 03, 2010 10:07 pm Post subject: |
|
|
| OK, it can help. |
|
| Back to top |
|
 |
|