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.
请告诉我 JavaScript 正则表达式:A.12345678.123 以“A”开头。后跟 8 位数字,后跟 '.' 又是 3 位数。
你可以试试这个: -
/^A\.[0-9]{8}\.[0-9]{3}$/
这用于匹配完整的字符串:
/^A\.\d{8}.\d{3}$/
匹配字符串的一部分删除 ^ 或 $。