In GREP tab:
change to $2
in Change Format field define your italic style.
Brilliant, thanks! worked exactly as I needed!
Make ensure the "italic" character style need to be available in the document.
Try the below code,
app.findGrepPreferences = app.changeGrepPreferences = null; app.findGrepPreferences.findWhat = "<i>(.+)<i>" app.changeGrepPreferences.changeTo = "$1"; app.changeGrepPreferences.appliedCharacterStyle = "italic"; app.activeDocument.changeGrep();
"GREP is greedy". <i>(.+)<i> won't work if you have more than one occurence of <i>some text<i> in a paragraph...