05-01-2013, 01:51 PM | #1 |
Member
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> Code:
<i>(.*)</i>\s<i>(.*)</i>\s 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> Last edited by dwlamb; 05-01-2013 at 02:12 PM. Reason: clarity |
05-01-2013, 02:13 PM | #2 |
Guru
Posts: 691
Karma: 3026110
Join Date: Dec 2008
Location: Lancashire, U.K.
Device: BeBook 1, BeBook Pure, Kobo Glo, (and HD),Energy Sistem EReader Pro +
|
Would a simple S&R on </i> <i> replaced by a space not do what you want.
i.e get rid of the adjacent end and start italic tags. Don't even need regex ! BobC |
Advert | |
|
05-01-2013, 02:13 PM | #3 |
Grand Sorcerer
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
|
05-01-2013, 05:09 PM | #4 |
A Hairy Wizard
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
That's what I use.
</i> <i> => {space} </i>, <i> => ", " </i>. <i> => ". " |
05-01-2013, 06:11 PM | #5 |
Member
Posts: 14
Karma: 10
Join Date: Apr 2013
Device: Android Smartphone
|
*sigh* Sometimes we get so close to the forest we can not see the trees.
Thanks for the help one and all. |
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
search for a file, a word or a phrase | GKj | Onyx Boox | 0 | 12-21-2012 05:55 AM |
Search and Replace | SOThunder | Conversion | 2 | 04-29-2012 08:29 AM |
Search and replace | TdeV | Sigil | 1 | 10-30-2011 04:45 PM |
search and replace - drops blanks in replace ? | cybmole | Conversion | 10 | 03-13-2011 03:07 AM |
Search and replace in 0.2.0 | paulpeer | Sigil | 7 | 03-13-2010 11:59 AM |