Jules #68: That's right, but I don't think you can achieve it in multiple sweeps of actual reformatting, because any proposed find strings (for world* and world!*) will select text beginning with an initial asterisk and go until it finds the matching ending asterisk, which could be multiple asterisks later and would lead to wonky underlining all over the place.
So I think in Word one would have to standardize all instances, by moving the asterisk to the appropriate position at the end of the underlined text, and then perform only one Find/Replace with reformatting. Find/Replace would be pretty powerful if they could add logical operators, or at the very least permit the "zero or more" as you indicate. Maybe a macro could do it.
Jules @ 40, I don't think that would catch text enclosed by asterisks but lacking punctuation. So, it would "see" *Hello world!* (make sure you escape the exclamation too) but not *Hello world*. If your text is:
The computer displayed *Hello world* when I wanted it to display *Hello world!* Alas, I shall have to start anew.
Since *Hello world* appears in the text before *Hello world!*, then Word will consider everything from the first asterisk to the last as a matching expression and underline it all.
... it fails when the text to be italicized ends with a question mark, a quotation mark, or a dash. What modification would handle that?
Hmm, well, one easy workaround would be (turn off the formatting first):
Find: (\*<[!\*]@)([\-.,;:'"\?\!])\*
Replace: \1*\2
That will find all instances of text enclosed by two asterisks where there is punctuation just inside the second asterisk. It then moves the punctuation to the outside of the asterisk.
And then do another sweep with the initial find and replace formulation.
Clunky, but it should work.
The only thing I would note on galloglass' elegant method is that it will underline all the text between any pair of asterisks. Therefore, if a single asterisk is used somewhere as a character, it will cause the wrong text to be underlined. So don't do "Replace All" blindly. One solution for this would be to restrict the search to instances where the two asterisks are followed and preceded by the beginnings and endings of words, not spaces, by using the following Find string:
\*<(*)>\*
(if the HTML coding fails to display properly, that's backslash-asterisk-lessthan-openparen-asterisk-closeparen-greaterthan-backslash-asterisk)
| Year | Number of comments posted |
|---|---|
| 2008 | 1 |
| 2007 | 4 |
Total: 5 comments. View all these comments on a single page.
The most recent 20 comments posted to Making Light by hooboy:
Show all comments by hooboy.