📜  保留多个分隔符正则表达式 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:05.329000             🧑  作者: Mango

代码示例1
Step 1:
Put all seperator(s) into /()/.
i.e. 1,2,3,4, so /(1234/)
Helpful Note: Remember to add \ if needed.
(If there is only one character, add flags after / at the end, and you're done!)
Then, add | after every character you want to be splited.
So now /(1|2|3|4)/
Then add flags
/(1|2|3|4|)/g
You're ready to use!
Hope this helps ;)