I am editing an e-book document with a lot of unnecessary markup. I have a number of sections in the text with code similar to this:
<i>Some text here</i>
I am trying to run a regex find and replace that will find any phrase between the two i-tags, remove the i-tags, and apply a style to the text.
Here is what I'm using to search:
Find: (<i>)(*)(</i>) Replace: \2
I'm also selecting Styles > i (for italic). This tells our conversion software to apply italics to the text. If I leave the i-tags, what ends up happening is ScribeNet's conversion process converts them to hex-values so that they show up as literal text in the e-book. Messy.
When I run this search, I get no results. I have "use wildcards" checked. What am I missing? According to Microsoft's help website, * is used to represent any number or type of characters, and individual strings are supposed to be enclosed in parentheses.
Find and replace basic text , type the word or phrase that you want to find, and Word will highlight all instances of the word or phrase throughout the document. To replace found text: Select the magnifying glass, and then select Replace. In the Replace With box, type the replacement text.
To search for a character that's defined as a wildcard, place a backslash (\
) before that character. The *
itself matches any string of characters, so use the range quantifier to match (1
or more times)
Find: \<i\>(*{1,})\</i\> Replace: \1
Search for \<i\>(*{1,})\</i\>
and replace with \1
. Don't forget to check Use wildcard
.
There is a reference table for Word's "regular expressions" here: http://office.microsoft.com/en-ca/word-help/find-and-replace-text-by-using-regular-expressions-advanced-HA102350661.aspx
<
and >
are special characters that need to be escaped*
means any character{1,}
means one or more timesIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With