2016-06-01 9 views
-1

英数字のような文字列(@ 1k546)を@patternアノテーションでチェックする方法。@patternアノテーションを文字列でチェックする方法2-2E454

+0

ご質問は非常に曖昧です。より具体的にこのヘルプを参照してください:http://stackoverflow.com/help/mcve –

+0

こんにちはRudy英数字と " - "(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) 
関連する問題