Lets say I have a bunch of text that needs to be italic. Throughout my text, italics are represented as:
_word_ _any_ _car_
And so on…
I want to find these, and replace them with word, car, any, and the like.
I was able to find one word with this expression.
I’m new to inDesign, but I am familiar with using Regular Expressions within Ruby. Ideally, I would like to remove the underscores and format them as Italic at once, using a style.
Create an italic character style (set some text to italic, select it and create a new style with the character styles dialogue)
In the paragraph styles dialogue, clear overrides to clear your italicized text and then right click on Body Text, selecting “Edit Body Text”
Click on GREP styles and then New GREP style.
Select the italic style you created previously and enter your grep expression
Should find all the words between underscores.
Click OK to apply the character style to the paragraph style, and viola – all text set to that paragraph style will have words between underscores italicized
Source : Link , Question Author : Astor139 , Answer Author : user22723