#1
|
|||
|
|||
Replacing curly braces in a wildcard F&R
The other day, I had a text document, copied into Word from an ancient word-processing program (developed just as cuneiform was declining), in which words or phrases to be italicized in a some other conversion were enclosed in curly brackets, either {single} or {{double}}. While I finally discovered how to search for a bracket by using its ASCII code (Unicode didn't work), I was unable to craft syntax for both find and replace fields allowing the equivalent of the asterisk (any number of characters) to be used as a replacement for anything inside such brackets, so that I could, in a single-stroke, as it were, italicize all such instances and remove the brackets at the same time. I don't know if this is possible in F&R or would require a multi-step macro.
I did the job manually in this case but would love to know how to set this up so that I can be efficient next time. I studied Graham Mayor's and Greg Maxey's sites; perhaps the answer is there and I simply didn't grasp it. |
#2
|
||||
|
||||
You could do this with a wildcard Find/Replace, where:
Find = [\{]{1,}[!\}]@[\}]{1,} Replace = nothing. Depending on your regional settings, you may need to change the two {1,} strings to {1;}.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Something amiss
Hello, Paul, and thank you. I have tried both with comma and semi-colon. Each returns a pop-up saying, "We [sic] couldn't find what you were looking for." (So nice to know that there's a whole team at my disposal in 2013.)
I am attaching my trial doc, just created for the test. What is my error? Philip (USA) |
#4
|
|||
|
|||
Addendum
Highlighting for your convenience only; it was not there during my test.
P |
#5
|
||||
|
||||
It works for me with your document. Did you check the 'Use wildcards' option?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
Hello again. Clearly, I did fail to check the wildcards box. However, my intention, evidently poorly stated at the beginning, for which I apologize, is not met your procedure, which has nothing in the replace field. So much for my ability to communicate. Let me try again.
My intention, is to keep but change the words within the brackets from roman to italics, and to remove the brackets, which are just an artifact of an antiquated word processor indicating that the words should be emphasized. Is there an expression for the replace field that will do this, or is a macro needed? Thank you, as always. |
#7
|
||||
|
||||
You could do that with a wildcard Find/Replace, where:
Find = ([\{]{1,})([!\}]@)([\}]{1,}) Replace = \2 or even: Find = [\{]{1,}([!\}]@)[\}]{1,} Replace = \1 and the replacement font is specified as italic (though I'm not sure what you mean by "from roman to italics", since Roman is a font name and italics is a font attribute that can apply to the Roman font).
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#8
|
|||
|
|||
I don't have a problem with roman, italic, bold and bold italic* as the four basic states/manifestations of a font :-} though there could be something to be said for 'normal' and I'll concede that the hypothetical case of Times Roman Roman would not sound elegant.
* R, I, B and X in the music-engraving program where I most often use these qualities. |
#9
|
||||
|
||||
Whatever works for you, then! Though outside that arena, I expect you'd get some puzzled responses if you described a font as 'Arial roman' or 'Tahoma roman', etc.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#10
|
|||
|
|||
Mysteries solved
Paul, many thanks. Your solution, of course, does the trick and gives me a model to study, as well.
With regard to my use of "roman", I'll let a Wikipedia entry, for what it may be worth, speak to the issue. To wit: In Latin-script typography, roman is one of the three main kinds of historical type, alongside blackletter and italic. Roman type was modelled on a European scribal manuscript style of the 1400s, based on pairing Roman square capitals used in ancient Rome with Carolingian minuscules developed in the Holy Roman Empire. During the early Renaissance, a publication would use either roman or italic type, not both. Today, roman and italic type are mixed, using roman for most of the text and italic for special purposes. Most typeface families include, at a minimum, roman, italic or oblique, and boldface character sets. The word roman, without a capital R, customarily denotes Italian typefaces used during the Renaissance period and later upright typefaces derived from them. Best, Ulodesk |
Tags |
curly brackets, find & replace, wild cards |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
curly quotes after em-dash or hard space | btorrance | Word | 0 | 06-07-2013 07:39 AM |
Wildcard for selective deleting | binar | Word | 1 | 01-10-2013 04:37 AM |
Balky Curly Quotes | JamesT | Word | 0 | 01-23-2010 05:36 PM |
Wildcard search help. | Kempston | Word | 0 | 11-13-2009 03:58 AM |
Extract from String using Wildcard | whousedmy | Word | 0 | 05-21-2009 01:35 AM |