Java regex for a method signature with a Collection<GenericType> return type
What would be the Java regular expression to match a Java method return type such as the following:
ArrayList<CodeObject开发者_运维技巧>
Given the existence of:
Map<List<String>, Map<List<String>, Collection<Integer>>>
just for starters, I'm going to claim that this is a bad job for a regexp. Regexps are not good at matching nested items. See this post for the deleterious effects on mental health of trying.
For the simple case I think the following would serve.
\p{javaJavaIdentifierStart}\p{javaJavaIdentifierPart}*<\p{javaJavaIdentifierStart}\p{javaJavaIdentifierPart}*>
精彩评论