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 数字?例如:1343151234234 有效,但 2342343ABC34234 无效。谢谢你。
^\d+$
使用“SingleLine”选项(在 C# 中是RegexOptions.SingleLine)。
RegexOptions.SingleLine