我需要製作一個不規則表達式,我打算用它來驗證表單數據。輸入是非常具體的數字類型(EMŠO),它是斯洛文尼亞人的唯一標識符。特定數字序列的正則表達式(EMŠO - 斯洛文尼亞)
The expression should be defined as:
- 1. position: only digits 0, 1, 2, 3
- 2. position: any digit
- 3. position: only digits 0 and 1
- 4. position: any digit
- 5., 6. and 7. position: any digit
- 8. position: must be a 5
- 9. position: must be a 0
- 10. position: only digits 0 and 5
- 11., 12. and 13. position: any digit
任何幫助將非常受歡迎。
你有什麼問題?這看起來很簡單。你可以使用'[xyz]'匹配任何字符'x','y'或'z',並使用'\ d'來匹配任何數字。 – Barmar
我',米只是很noob在這...我用來驗證分裂的字符串和字符...但我不想這樣做這樣做 –
SO是不是一個輔導服務,你必須做你自己的研究。閱讀www.regular-expression.info上的教程。 – Barmar