如果没有太复杂的多行文字,也可以使用:
- (setq cTxt "{\\fArial|b1|i0|c0|p34;\\L{\\H0.7x;\\C4;\\S2#3;}\\O\\KA\\C3;b[color="blue"]\t[/color]\\l\\o\\k\\C5;c}d {\\C5;;} E[color="#ff00ff"]%%C[/color]{\\L\\O\\K\\C1;fg\\C256;h[color="lime"]\\P[/color] \\fISOCPEUR|b0|i0|c0|p34;\\C6;[color="red"]\U+2220[/color] z\\l\\o\\k\\C256; x} {\\H0.7x;\\C4;\\S[color="#a0522d"]1#2[/color];}")
- (foreach e '(("\\K" "") ("\\L" "") ("\\O" "") ("\\P" "\n") ("\\S" "") ("\\k" "") ("\\l" "") ("\\o" "") ("\\p" "\n") ("{" "") ("}" "") ("\\U" "§") )
- (setq cV (car e) cN (cadr e) ) ;_ end of setq
- (while (setq pS (vl-String-Search cV cTxt)) (setq cTxt (vl-String-Subst cN cV cTxt)) (if (= cV "\\S") (setq cTxt (vl-String-Subst "" ";" (vl-String-Subst "/" "#" cTxt) pS)) ) ) ;_ end of wh
- ) ;_ end of f
-
- (while (and (setq pS (vl-String-Search "\" cTxt pS)) (setq pE (vl-String-Search ";" cTxt pS)) )
- (setq cTxt (vl-String-Subst "" (substr cTxt (1+ pS) (1+ (- pE pS))) cTxt) ) ;_ end of setq
- ) ;_ end of wh pS
- (while (vl-String-Search "§" cTxt) (setq cTxt (vl-String-Subst "\\U" "§" cTxt)) ) ;_ end of wh
cTxt=“2/3Ab\tcd;E%%Cfgh\n\U+2220z x 1/2” |