2016-06-01 1 views
-1

영숫자와 같은 문자 (1-1k546)로 @pattern annotation을 검사하는 방법.@pattern annotation에서 문자열을 확인하는 방법 2-2E454

+0

매우 모호합니다. 좀 더 구체적으로이 도움말을 참조하십시오 : http://stackoverflow.com/help/mcve –

+0

안녕 루디 영숫자와 "-"(1-1k546)와 같은 문자열을 @pattern에서 확인하는 방법 –

+0

@Pattern (regexp = "^ [0-9a-zA-Z., \ '_ + *()?; : \"&! $ % # @ = | {} [] \\/® ™ -] * $ "). constarintvalidationexception 수정 방법 –

답변

0
\d-[0-9a-zA-Z]+ 

\d match a digit [0-9] 
- matches the character - literally 
[0-9a-zA-Z]+ match a single character present in the list below 
    Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy] 
    0-9 a single character in the range between 0 and 9 
    a-z a single character in the range between a and z (case sensitive) 
    A-Z a single character in the range between A and Z (case sensitive) 
관련 문제