We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
/** * fzq 4.23 */ let str = '((2+3)+(3*4))+2' function print(str) { const res = [] matchRes = '' str = str.replace(/\(\(([\d\D]+)\)\)/g, function (match) { matchRes = match.substring(1, match.length - 1) res.push(matchRes) }) matchRes.replace(/\([\s\S]+?\)/g, function (match) { // 非贪婪匹配 res.push(match) }) return res } console.log(print(str));// ['(2 + 3)+(3 * 4)', '2 + 3', '3 * 4']
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: