View Single Post
Old 03-24-2014, 07:49 AM   #3
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,605
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
\w does not mean match a "word." So if follows that \w+ does not mean "one or more words."

\w is a shortcut for a word character. Singular. Which (most commonly) translates to [A-Za-z0-9_]. A space is not a word character--which is why your regex stopped matching when it encountered the space between words. There really is no regex shortcut for matching a "word." You can find the boundaries between words, though. Some regex flavors (calibre's for example) can match the beginnings or ends of words.

Toxaris's suggestion should do what you want (unless there are any complicated, nested i tags--which isn't very likely).

You could also search for:
Code:
<(/?)i( class=".*?")?>
And replace with:
Code:
<\1em>
Which will match/alter the tags while ignoring their contents. You may have to uncheck/check any "minimal matching/greedy" option your particular search engine might have.

Last edited by DiapDealer; 03-24-2014 at 08:22 AM.
DiapDealer is online now   Reply With Quote