I need to determine if a string is a variable identifier.
i.e. (a-z,A-Z,,$) followed by (a-z开发者_如何学Python,A-Z,0-9,,$)
I know I can do it with a manually configured reg exp, but there must be a more compact, built in function I can use.
Any solutions?
You can use the methods Character.isJavaIdentifierStart() and Character.isJavaIdentifierPart() but I don't think the solution will be more compact.
EDIT: I decided to search and found this in Codemodel: http://codemodel.java.net/nonav/apidocs/com/sun/codemodel/JJavaName.html
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论