Skip to main content
Participant
February 16, 2019
Answered

Finding a lone plain text character among italics in a string.

  • February 16, 2019
  • 1 reply
  • 462 views

Hi everyone, I have come across an issue with a long document I'm working on. I've noticed that there are instances of a single plain text character at the beginning of a word where the entire word is meant to be in italics. The rest of the word is properly italicized but the single beginning character is in plain text. Is there a Find/Change GREP string or scripting method that can help to search and find all of these instances? Thanks for any help!

This topic has been closed for replies.
Correct answer winterm

In F/C GREP tab:

Find what:

\b\w(?!.)

Change to:

leave blank

Find Format: +Regular

Change Format: +Italic

Two notes:

1. it’s better practice to use char styles, not direct formatting, as per your words and my sample.

2. Use with caution! Due to F/C limitations you can't search for two different formattings simultaneously. For example, WORD also will be found and formatted as WORD (italic and bold), because effectively this regex searches for words where the first letter is regular while the 2nd is not. Not exactly 'italic', just 'non regular'.

1 reply

winterm
wintermCorrect answer
Legend
February 16, 2019

In F/C GREP tab:

Find what:

\b\w(?!.)

Change to:

leave blank

Find Format: +Regular

Change Format: +Italic

Two notes:

1. it’s better practice to use char styles, not direct formatting, as per your words and my sample.

2. Use with caution! Due to F/C limitations you can't search for two different formattings simultaneously. For example, WORD also will be found and formatted as WORD (italic and bold), because effectively this regex searches for words where the first letter is regular while the 2nd is not. Not exactly 'italic', just 'non regular'.

Participant
February 16, 2019

Thanks! That seems to work.

Yes, I always assign paragraph and character styles but due to the inconsistencies in the original manuscript, this GREP query was exactly what was needed. I appreciate the help.