Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人可以帮我写一个正则表达式,它开始匹配字符串中的任何数字 0 到 9、逗号、句点或括号,只要它们匹配到空格或以下符号之一:+、-、*、或者 /?
使用积极的前瞻表达式:
[\d,.()]+($|(?=[-+*/\s]))
直到它碰到一个空格或这些符号之一通常是[^ */+-]+.
[^ */+-]+