.
および以外の「特殊」文字を含む任意の文字列に正規表現を一致させたい/
。他の特殊文字は一種のブラックリストにあります。ただし、実行時にIllegal repetition
エラーが発生します。どうすれば解決できますか?
Pattern regex = Pattern.compile("!@#$%^&*()-_+=|\\}]{[\"':;?><,");
Matcher matcher = regex.matcher(key);
if (matcher.find()) {
return false;
}