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.
我正在尝试编写一个简单的正则表达式来匹配百分比值范围 1%-100%
有没有更好的方法来写这个?
^([1-9]|[1-9][0-9]|100)%$
你可以让它更短一点:
^([1-9][0-9]?|100)%$