【发布时间】:2011-08-16 04:15:45
【问题描述】:
我在 Centos 上使用 sed,bash。
我想将 \plain 和 }} 之间的所有内容替换为以下文本行中的空格:
stuff here \plain \f2\fs20\cf2 4:21-23}} more stuff over here, could be anything.
\plain 和 }} 之间的文本会有所不同(不同的数字/数字)。如何使用通配符来包含 \plain 和 }} 之间的所有内容。
我希望一个简单的 * 可以抓住两者之间的所有内容,但 shell 中的通配符似乎不能像这样工作:
s/\\plain *}}/ /g;
答案可能是包含这个的东西? [a-zA-Z0-9.] 但这不包括文本中的反斜杠、冒号和破折号。
【问题讨论】:
标签: bash search replace sed wildcard