我发现了这个Java正则表达式,但不知道它匹配什么?
Pattern.compile("\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*(\\.\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*)*");
javaJavaIdentifierStart
匹配什么内容?
我发现了这个Java正则表达式,但不知道它匹配什么?
Pattern.compile("\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*(\\.\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*)*");
javaJavaIdentifierStart
匹配什么内容?
isJavaIdentifierStart
public static boolean isJavaIdentifierStart(char ch)
Determines if the specified character is permissible as the first character in a Java identifier.
A character may start a Java identifier if and only if one of the following conditions is true:
isLetter(ch) returns true
getType(ch) returns LETTER_NUMBER
ch is a currency symbol (such as "$")
ch is a connecting punctuation character (such as "_").
Note: This method cannot handle supplementary characters. To support all Unicode characters, including supplementary characters, use the isJavaIdentifierStart(int) method.
Parameters:
ch - the character to be tested.
Returns:
true if the character may start a Java identifier; false otherwise.
Source (which is a bit more readable)