새로운 <input type="email" />
요소를 사용하고 싶습니다. 나는 브라우저에서 발생하는 서버에서 동일한 유효성 검사를 구현하는 Java 코드를 원합니다.HTML5 입력 전자 메일 유효성 검사의 Java 구현이 있습니까?
1*(atext/".") "@" ldh-str *("." ldh-str)
where :
<ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str>
<let-dig-hyp> ::= <let-dig> | "-"
<let-dig> ::= <letter> | <digit>
<letter> ::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case
<digit> ::= any one of the ten digits 0 through 9
The HTML5 spec defines email addresses
atext = ALPHA/DIGIT/ ; Printable US-ASCII
"!"/"#"/ ; characters not including
"$"/"%"/ ; specials. Used for atoms.
"&"/"'"/
"*"/"+"/
"-"/"/"/
"="/"?"/
"^"/"_"/
"`"/"{"/
"|"/"}"/
"~"
이들은 하지 동일한 규칙은 01,236,108,938 같이 있습니다. 주소가 Java에서 이러한 규칙을 준수하는지 테스트 할 수 있습니까?
감사합니다.
당신은 정규식 사용할 수 있습니다
readymade 솔루션이 있는지는 잘 모르겠지만 아무 것도 찾을 수 없다면 PEP로 쉽게 만들 수 있습니다. http://www.ling.ohio-state.edu/~scott/ – biziclop