Skip to content

Commit 3dac3b5

Browse files
authored
fix(ReadRTF): 某些情况下 DEL_RTF_CTRL 不生效 (#64)
对比以下两个正则表达式: 1. https://jianyu.io/regulex/#!flags=&re=%5C%7B%3F%5C%5Csuper%5Cs*((%3F%3A%5C%5C%5B%5C%5C%5C%7B%5C%7D%5D%7C%5B%5E%5C%5C%5C%7B%5C%7D%5D)%2B)%5C%7D%3F ``` \{?\\super\s*((?:\\[\\\{\}]|[^\\\{\}])+)\}? ``` 2. https://jianyu.io/regulex/#!flags=&re=%5C%7B%3F%5C%5Csuper%5Cs%2B((%3F%3A%5C%5C%5B%5C%5C%5C%7B%5C%7D%5D%7C%5B%5E%5C%5C%5C%7B%5C%7D%5D)%2B)%5C%7D%3F ``` \{?\\super\s+((?:\\[\\\{\}]|[^\\\{\}])+)\}? ``` 对于某个 RTF 段落 `\'CC\'DE\'B3\'FD{\super [3]}, n(%){\super [4]}\cell}`,前者可以正常匹配,后者无法匹配。
1 parent 97fdbd4 commit 3dac3b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gbk/ReadRTF.sas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ options cmplib = sasuser.func;
332332
%let reg_ctrl_3 = %bquote(\\nosupersub);
333333

334334
/*控制字-上标*/
335-
%let reg_ctrl_4 = %bquote(\{?\\super\s+((?:\\[\\\{\}]|[^\\\{\}])+)\}?); /*
335+
%let reg_ctrl_4 = %bquote(\{?\\super\s*((?:\\[\\\{\}]|[^\\\{\}])+)\}?); /*
336336
https://github.com/Snoopy1866/RTFTools-For-SAS/issues/20
337337
https://github.com/Snoopy1866/RTFTools-For-SAS/issues/26
338338
*/

0 commit comments

Comments
 (0)