$ aa $BBBB $ aa $bb $ aa $DDD $ aa \ $aaa $
Every two $is a set, extract content between this group.
Consult, thank you for your warrior, try a few times without success.
CodePudding user response:
STR. The split () triedReference: https://www.w3school.com.cn/js/jsref_split.asp
CodePudding user response:
Var STR="$$$aa BBBB $bb $aa aa aa \ \ $DDD $$$" aaa.
Var arr=[];
STR. Replace (/\ $(. *? \ [^ \ \ \ $]) $/g, the function (s, a) {
Arr. Push (a);
});
Alert (arr);