假设我有这个块:
Yuml-Output-List: [ {note: Wordpress Profiles{bg:beige}
[Blogger]^[User]
[Admin]^[Blogger]
[Author]^[Blogger]
[Subscriber]^[User]
}
{note: Blogger Role{bg:beige}
[Blogger]-(Manage Posts)
}
{note: Admin Roles{bg:beige}
[Admin]-(Manage Site)
(Manage Site)>(Manage Users)
(Manage Site)>(Manage Themes)
(Manage Site)>(Manage Plugins)
}
]
如果我想将结果复制到剪贴板:
clipboard: copy ""
foreach element Yuml-Output-List [
append clipboard element
append clipboard newline
append clipboard newline
]
write clipboard:// clipboard
我得到 ESC 字符INSTEAD ^:
note: Wordpress Profiles{bg:beige}
[Blogger]ESCUser]
[Admin]ESCBlogger]
[Author]ESCBlogger]
[Subscriber]ESCUser]
note: Blogger Role{bg:beige}
[Blogger]-(Manage Posts)
note: Admin Roles{bg:beige}
[Admin]-(Manage Site)
(Manage Site)>(Manage Users)
(Manage Site)>(Manage Themes)
(Manage Site)>(Manage Plugins)
那么如何摆脱逃生输出?
答案 0 :(得分:1)
由于这是一个REBOL字符串,^ [表示一个ESC字符,因为^用于转义序列。
所以,你要做的是用插入符号和左括号替换现有的ESC字符:
replace/all source "^[" "^^["
注意^^,因为你需要转义^,左括号现在不再被转义。