For in-place replacement, the quick option would be to use the Find and Replace dialog (Ctrl + H
) with Search Using Regular Expressions turned on, which is more powerful than your standard Find and Replace.
- Find:
[.*?]
- Match anything within an open-bracket up to the very next close-bracket. This should work assuming you have no nested brackets, e.g. [[no][no]]
.
- If you do have nested brackets, you'll have to change this to
[[^[]]*]
. And continue to Replace All until all the codes are gone.
- Replace: Nothing.
- Replace All. If you don't want to affect other sheets that may be in your document, make sure you select the right range to work with, too.
This just erases everything within the brackets.
If you want to erase any redundant spaces left by this, simply Find and Replace again (with Regular Expressions) on +
(space and plus), which will match 1 or more spaces and replace with
(single space).
E.g.:
string [] [] string2
-> string string2
after the shortcode replacement.
- After replacing spaces, it will become
string string2
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…