1
A
回答
5
這個怎麼樣:
^(?!0{10})\d{10}$
說明:
The regular expression:
(?-imsx:^(?!0{10})\d{10}$)
matches as follows:
NODE EXPLANATION
----------------------------------------------------------------------
(?-imsx: group, but do not capture (case-sensitive)
(with^and $ matching normally) (with . not
matching \n) (matching whitespace and #
normally):
----------------------------------------------------------------------
^ the beginning of the string
----------------------------------------------------------------------
(?! look ahead to see if there is not:
----------------------------------------------------------------------
0{10} '0' (10 times)
----------------------------------------------------------------------
) end of look-ahead
----------------------------------------------------------------------
\d{10} digits (0-9) (10 times)
----------------------------------------------------------------------
$ before an optional \n, and the end of the
string
----------------------------------------------------------------------
) end of grouping
----------------------------------------------------------------------
相關問題
- 1. 正則表達式來檢測數字,但不是十進制
- 2. 十位數字的正則表達式
- 3. 非零負數十進制數的正則表達式
- 4. 正則表達式十六進制數
- 5. 十進制數的正則表達式
- 6. 正則表達式接受十進制數字,但不是單一的0
- 7. 的Javascript正則表達式:九個或十位數字符串
- 8. 正則表達式:用十進制數字和數字匹配
- 9. 只有數字,這個數字可能是十進制的(正則表達式)
- 10. 正則表達式十進制到int
- 11. 正則表達式幫助十進制
- 12. 十進制正則表達式問題
- 13. 十進制值的正則表達式
- 14. Java十六進制正則表達式
- 15. 正則表達式 - 十進制
- 16. 正則表達式 - 十進制的
- 17. 非零十六進制值的正則表達式
- 18. 正則表達式爲字符串中的十進制數字
- 19. 正則表達式字符串用於驗證不包括零的十進制
- 20. 正則表達式返回<_s而不是十進制值
- 21. 正則表達式,找到數字,0或十進制
- 22. 從正則表達式字符串中的十進制數
- 23. c#正則表達式的數字範圍十進制
- 24. 正則表達式全部位數,但不是唯一的零
- 25. 匹配#tags但不是十六進制代碼的正則表達式
- 26. 正則表達式不承認十進制數以及
- 27. 使用正則表達式分裂出一個十進制數
- 28. 用字母和十六進制表示的正則表達式
- 29. 正則表達式正則表達式正則表達式使用正則表達式,但不是與Python
- 30. 正則表達式幫助:十進制正數,2位
這是基本相同[這個問題](http://stackoverflow.com/questions/20144315/regex-creating-an-exception-for-ra-b-c)。一個正則表達式,應該匹配它所做的所有事情,*除了特定的字符串。 –