• [email protected] to act as a placeholder in positions 1-3
• Asterisks are permitted in positions 2-5.
• Position One should be alphabetic (except for the [email protected])
• No characters should accept numbers.
• Other than the exceptions mentioned above, no special characters are allowed
意味着,如果我的第一個字拼音IA隨後2-5可以是字母或*(2-5不是強制性的,但如果我們再進入應該是α或*)正則表達式匹配條件
但如果我們使用〜那麼2-3位應該是!@。
現在我使用
^[a-zA-Z~][a-zA-Z*]{0,4}[a-zA-Z]*$", Pattern.CASE_INSENSITIVE)
你真的需要澄清你想要做什麼 – Vajura 2014-10-10 08:43:06
請添加預期的結果(一個或兩個匹配的字符串,以及一個或兩個不應該匹配的) – Supamiu 2014-10-10 08:43:49
字符串的最小長度是多少? – 2014-10-10 10:56:22