View Single Post
Old 05-01-2013, 01:51 PM   #1
dwlamb
Member
dwlamb began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Apr 2013
Device: Android Smartphone
search and replace on phrase

I am undertaking a conversion from an export of an odt file and wish to do a regular expression search and replace of strings of words individually italicised instead of the entire phrase.

I have
Code:
<i>something</i> <i>like</i> <i>this</i>

and want

<i>something like this</i>
I came up with this
Code:
<i>(.*)</i>\s<i>(.*)</i>\s
but at times it is too greedy, trapping
Code:
<i>something</i> <i>like</i> <i>this</i> blah blah. More words and then <i>another</i> <i>string</i> <i>in</i> <i>italics</i>
Any ideas would be most welcome for how to write the search string and not trap a large block in between phrases

Last edited by dwlamb; 05-01-2013 at 02:12 PM. Reason: clarity
dwlamb is offline   Reply With Quote