The regex \b[KVEWZRXIMA]{9}\w+
means: Match 9 characters of the set KVEWZRXIMA
next to each other, just after a word boundary and just before there is at least one other word-character.(正则表达式\b[KVEWZRXIMA]{9}\w+
意思是:在单词边界之后且KVEWZRXIMA
至少一个其他单词字符之前,将匹配的KVEWZRXIMA
9个字符彼此相邻。)
The order of the characters in the set is irrelevant.(集合中字符的顺序无关紧要。) It's an unordered set of characters.(这是一组无序的字符。)
The string would match eg KKKKKKKKKh
because there are 9 characters next to each other and all of those 9 characters are in the predefined set ( K
is within [KVEWZRXIMA]
).(该字符串将匹配例如KKKKKKKKKh
因为彼此KKKKKKKKKh
有9个字符,并且所有这9个字符都在预定义集中( K
在[KVEWZRXIMA]
)。) So, if you want to match all alphabet characters, you can just use [AZ]{9}
, then it has to be a character in the set of [AZ]
9 times.(因此,如果要匹配所有字母字符,则只能使用[AZ]{9}
,它必须是[AZ]
集中的字符9次。)
If you want to rely on the order of the characters, you cannot use an unordered set of characters, but you need to actually use the characters within the regex (outside of []
).(如果要依赖字符的顺序,则不能使用无序的字符集,但实际上需要使用正则表达式( []
之外)中的字符。)
Please comment, if you have further questions.(如果您还有其他问题,请发表评论。) 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…